Closed
Bug 619657
Opened 15 years ago
Closed 15 years ago
(Blind?) SQL injection vulnerability in statistics of a specific addon
Categories
(addons.mozilla.org Graveyard :: Statistics, defect)
addons.mozilla.org Graveyard
Statistics
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: Pa7r1ck, Assigned: clouserw)
References
()
Details
(Keywords: reporter-external, wsec-sqli, Whiteboard: [infrasec:sqlinject][ws:critical])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
While viewing the statistics of a specific addon, a user could manipulate the
Addon-ID in the URL, to inject SQL Code.
Afaik, its only possible to blindly inject sql code:
https://addons.mozilla.org/de/statistics/addon/6826%20AND%20SUBSTRING%28version%28%29,1,1%29=5
This code gets the mysql-version and compares the first char (5) to "5".
If you try:
https://addons.mozilla.org/de/statistics/addon/6826%20AND%20SUBSTRING%28version%28%29,1,1%29=4
the statistics dont load -> the statement was false -> the version isnt 4.*
Reproducible: Always
Steps to Reproduce:
1. Go to https://addons.mozilla.org/de/statistics/
2. Select any Addon with public statistics
3. Add an apostrophe at the end of the URL after the Addon-ID
4. The statistics is set to zero -> Error in the MySQL Statement
5. Add "AND 1=1" after the Addon-ID without an apostrophe-> The statistics loads perfectly -> the MySQL Statement was successful
6. Replace the "AND 1=1" with "AND 1=0" -> This condition is false -> The MySQL statement fails -> Statistics are zero again.
Actual Results:
-> It shows, that it's possible to inject SQL Code - a blackhat might be able to read userdata like passwords and manipulate the DB and stuff like this.
Expected Results:
Filtered the injected code, validate the ID to be integer with a function like intval() or something.
| Reporter | ||
Updated•15 years ago
|
Whiteboard: [infrasec:sqlinject]
Updated•15 years ago
|
Assignee: nobody → clouserw
Updated•15 years ago
|
OS: Windows XP → All
Hardware: x86 → All
Comment 1•15 years ago
|
||
Need to look at code, but the results of the test below point to SQL injection
Fails:
https://addons.mozilla.org/en-US/statistics/addon/6826%20AND%201=2
Works:
https://addons.mozilla.org/en-US/statistics/addon/6826%20AND%201=1
| Assignee | ||
Comment 2•15 years ago
|
||
Yeah, this is fixed on preview and is going out shortly
| Assignee | ||
Comment 3•15 years ago
|
||
| Assignee | ||
Comment 4•15 years ago
|
||
You can see from the patch what was going on. The variables are cleaned for stuff like quotes so I'm not sure how much you could do with this, but the new patch verifies they are numbers.
| Reporter | ||
Comment 5•15 years ago
|
||
(In reply to comment #4)
> You can see from the patch what was going on. The variables are cleaned for
> stuff like quotes so I'm not sure how much you could do with this, but the new
> patch verifies they are numbers.
Depends.
If the mysql-user on whos account the statement in the code was run got enough privileges, someone could have at least read usernames/passwords, login in a famous account and exchange the addon with malicious code.
I don't know the the infrastructure of mozillas mysql db and the needed privileges to read passwords.
Updated•15 years ago
|
Whiteboard: [infrasec:sqlinject] → [infrasec:sqlinject][ws:critical]
Updated•15 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 14•15 years ago
|
||
Been fixed for awhile. Just updating status to "VERIFIED"
Status: RESOLVED → VERIFIED
Updated•13 years ago
|
Flags: sec-bounty+
Updated•10 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
Updated•9 years ago
|
Group: client-services-security
Updated•2 years ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•