git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Confirm my false error suspicions of Gitweb query injection

From
JLJoseph Leong <josephcleong@gmail.com>
Date
Sep 10, 2012, 16:45 UTC
Message-ID
<CAMOg_eUjmnisevN+AaArz+6TMpWYJL660xwG0ptEaTO7stcL6A@mail.gmail.com>
Hi Everyone,
I'm using Gitweb (Based on Git 1.7.9 on RHEL 5.8).

I was poking around and tried a GET Request (REQ) with some SQL statements as a search query and noticed a 500. Can i just confirm with anyone here that the error message I'm seeing in the Response (RESP) is basically saying that the search parameters are invalid because of it's funny chars are breaking the regex search and that it's not anything database related. Thank you!

[REQ] GET /git/?s=%28select+1234%2C HTTP/1.0

[RESP] 500 - Internal Server Error Unmatched ( in regex; marked by &lt;-- HERE in m/( &lt;-- HERE select 1234,/ at /var/www/git/gitweb.cgi line 4845.

[Code at gitweb.cgi line 4845] next if $searchtext and not $pr->{'path'} =~ /$searchtext/ and not $pr->{'descr_long'} =~ /$searchtext/;

Next: Matthieu Moy
Message 1 of 4 in “Confirm my false error suspicions of Gitweb query injection”
  1. Joseph LeongSep 10, 2012
  2. Matthieu MoySep 10, 2012
  3. Junio C HamanoSep 10, 2012
  4. Joseph LeongSep 10, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.