Edgewall Software
Modify

Opened 20 years ago

Closed 19 years ago

#1418 closed defect (duplicate)

Dynamic variables in reports should be escaped

Reported by: nil4 Owned by: daniel
Priority: normal Milestone:
Component: report system Version: devel
Severity: critical Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The code in Report.py — sql_sub_vars only does a simple string substitution on the dynamic variables, with no escaping of dangerous characters (including backslash). I see two problems with this approach:

  • It opens the door for SQL injection attacks on the sqlite database of trac repositories.
  • It makes it impossible to write reports that use the $USER variable when users are authenticated in a domain, since the backslash is interpreted as a string escape modifier.

For example, the following code fails with an error, when the logged user is domain\username:

SELECT * FROM ticket WHERE owner = '$USER'

Attachments (0)

Change History (2)

comment:1 by nil4, 20 years ago

Summary: Dinamic variables in reports should be escapedDynamic variables in reports should be escaped

Actually, I just saw the values of dynamic variables are restricted by regexes, so I guess they're safe from SQL injection attacks.

Still, there's no way I can use to create reports for users authenticated in a Windows domain.

comment:2 by Matthew Good, 19 years ago

Resolution: duplicate
Status: newclosed

This was addressed in #2536

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain daniel.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from daniel to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.