MaaS API is vulnerable to XSS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Julian Edwards | ||
1.2 |
Fix Released
|
Critical
|
Julian Edwards | ||
1.4 |
Fix Released
|
Critical
|
Julian Edwards |
Bug Description
The MaaS API is vulnerable to Cross site scripting attacks allowing an unprivileged user to steal admin sessions.
A potential attacker can execute arbitrary javascript code in the admin's browser (in the site's document.domain) should he manage to trick him/her into clicking a forged link.
Example:
The following link can be expanded to hijack the admin user's session:
"http://
Note: some browsers (like Chrome) sanitize the URL bar, and therefore an attacker would need to craft a form (to pass the "op" parameter as a POST parameter rather than a GET).
Demonstrating the POST version can be done with:
curl --data "op=<script>
Suggestion:
1. Sanitizing all error returned to the user via the API as "not containing the characters '<' and '>'" (since the API should only return JSON).
2. Make all API URLs return "text/json" as their only content-type will further harden the application (since browsers won't even try to interpret code on non text/html pages).
Related branches
- Raphaël Badin (community): Approve
-
Diff: 74 lines (+19/-4)4 files modifiedsrc/maasserver/api_support.py (+4/-2)
src/maasserver/tests/test_api.py (+11/-0)
src/maasserver/tests/test_api_enlistment.py (+1/-1)
src/maasserver/views/combo.py (+3/-1)
- Julian Edwards (community): Approve
-
Diff: 66 lines (+16/-4)3 files modifiedsrc/maasserver/api.py (+1/-2)
src/maasserver/tests/test_api.py (+12/-1)
src/maasserver/views/combo.py (+3/-1)
- Julian Edwards (community): Approve
-
Diff: 71 lines (+17/-4)4 files modifiedsrc/maasserver/api_support.py (+2/-2)
src/maasserver/tests/test_api.py (+11/-0)
src/maasserver/tests/test_api_enlistment.py (+1/-1)
src/maasserver/views/combo.py (+3/-1)
CVE References
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → Critical |
Changed in maas: | |
assignee: | nobody → Julian Edwards (julian-edwards) |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Contacted Seth Arnold about this - holding off landing until packages are landed in Ubuntu.