#24625 closed Bug (fixed)
Arbitrary file inclusion in admindocs
Reported by: | Markus Holtermann | Owned by: | Markus Holtermann |
---|---|---|---|
Component: | contrib.admindocs | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After consulting with the security team we're treating this issue as a hardening:
django.contrib.admindocs
relies on Docutils to render the docstrings. Docutils has the two directives "raw" or "include" to include files. By installing a 3rd party app and not carefully reviewing model, view or other docstrings, an attacker can insert arbitrary HTML code posing as a XSS vulnerability as well as include arbitrary files, e.g. the Django project settings, potentially revealing the database password and secret key.
Change History (9)
comment:1 by , 10 years ago
Has patch: | set |
---|---|
Needs tests: | unset |
comment:2 by , 10 years ago
Needs documentation: | unset |
---|
comment:3 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I don't really see the issue as needing a backport based on our current policy, but I don't mind other than the perception that the core team plays by different rules. Do you want to lobby for adding "security hardening measures" to the list of fixes that will be backported?
comment:4 by , 10 years ago
I think that when a core dev is volunteering to backport a patch, he should be allowed to do so (unless it obviously adds some regression risks).
comment:5 by , 10 years ago
I think it mostly depends on the size and impact of the patch. The one for this issue is rather trivial and users who run into a regression with it will have other problems than outlined in this issue. Since it's not a security issue per se I'm fine with not backporting it to anything. It just feels dump to keep that issue in a release that we'll support for 3+ years which is why I'm +1 on backporting it to 1.8. Those users who are on 1.7 are likely going to update to 1.8 sooner or later and are fine then.
PR: https://github.com/django/django/pull/4478