Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#13177 closed (fixed)

Unescaped user input in the Admin interface

Reported by: Fletcher Tomalty Owned by: nobody
Component: contrib.admin Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Steps to reproduce:

  1. Go into the Django User Admin interface
  2. Open a given user
  3. Enter <script>alert('asdf')</script> into the First Name field
  4. Press "Save and Continue Editing"

Basically, a {% firstof %} tag in the Admin templates isn't escaping the user's First name. This can be fixed by putting simple {% filter force_escape %} around it.

The bug can be found in /django/contrib/admin/templates/admin/base.html, a modifired version of which is attached.

Attachments (1)

base.html (3.3 KB ) - added by Fletcher Tomalty 14 years ago.
The patched admin template file

Download all attachments as: .zip

Change History (6)

by Fletcher Tomalty, 14 years ago

Attachment: base.html added

The patched admin template file

comment:1 by Fletcher Tomalty, 14 years ago

Has patch: unset

Also, ticket #10912 deals with escaping of template tags... should be an overall fix.

comment:2 by Fletcher Tomalty, 14 years ago

Has patch: set
Needs tests: set

comment:3 by Russell Keith-Magee, 14 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:4 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: newclosed

(In [12841]) [1.1.X] Fixed #13177 -- Corrected usage of firstof in admin templates. Thanks to nomulous for the report and patch.

Backport of r12840 from trunk.

comment:5 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top