Closed Bug 701920 Opened 14 years ago Closed 13 years ago

use prepared statements in dxr to avoid sql injection

Categories

(Webtools Graveyard :: DXR, defect)

x86
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: taras.mozilla, Assigned: carlos)

Details

Attachments

(1 file, 1 obsolete file)

I propose using placeholders and abandon the custom quoting. Also since I noticed it, I removed fetch_all here and a handful more places so that rows are iterated over and not kept in memory completely.
Attachment #574579 - Flags: review?(Pidgeot18)
Why not use the DB-API’s parameter substitution (http://docs.python.org/library/sqlite3.html#sqlite3.Cursor.execute)? Or am I missing something here?
Ah, Christian's patch is doing that. I was confused by the name placeholders. Sorry for the noise!
I discovered that I left out the % from the LIKE, the updated patch corrects that.
Attachment #574579 - Attachment is obsolete: true
Attachment #574579 - Flags: review?(Pidgeot18)
Attachment #575201 - Flags: review?(Pidgeot18)
Assignee: nobody → christian.dywan
Attachment #575201 - Flags: review?(Pidgeot18) → review?(ehsan)
Status: NEW → ASSIGNED
How does removing the fetchall calls help with SQL injection attacks?
Comment on attachment 575201 [details] [diff] [review] use prepared statements in dxr to avoid sql injection #2 Clearing the request waiting on the response to my comment...
Attachment #575201 - Flags: review?(ehsan)
(In reply to Ehsan Akhgari [:ehsan] from comment #5) > How does removing the fetchall calls help with SQL injection attacks? It doesn't. I just wasn't keen on a tiny second patch with that huge number of unreviewed patches waiting to conflict. Feel free to split it or whatever.
Attachment #575201 - Flags: review?(ehsan)
Comment on attachment 575201 [details] [diff] [review] use prepared statements in dxr to avoid sql injection #2 Nah, not worth splitting...
Attachment #575201 - Flags: review?(ehsan) → review+
That one is mostly fixed
Assignee: christian → carlos
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: