Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#6729 closed defect (wontfix)

Suppress bad SQL in TracReports

Reported by: trac-ja@… Owned by: Christian Boos
Priority: normal Milestone:
Component: report system Version:
Severity: normal Keywords:
Cc: trac-ja@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

TracReports allows all SQL and query: semantec now, and user that granted REPORT_MODIFY can't write only SELECT, but also INSERT, UPDATE, DELETE, CREATE and DROP. I think it should allows only SELECT and query:.

Attachments (1)

Trac-0.11b1_reportsql_r383.patch (3.5 KB ) - added by trac-ja@… 17 years ago.
Patch against Trac-0.11b1

Download all attachments as: .zip

Change History (6)

by trac-ja@…, 17 years ago

Patch against Trac-0.11b1

comment:1 by Christian Boos, 17 years ago

Those "wrong" queries should normally never get commit'ted, so normally no harm can be done (well, except for the DROP and CREATE with SQLite, which don't need a commit to be effective, IIRC).

in reply to:  1 comment:2 by trac-ja@…, 17 years ago

Replying to cboos:

Those "wrong" queries should normally never get commit'ted, so normally no harm can be done (well, except for the DROP and CREATE with SQLite, which don't need a commit to be effective, IIRC).

Yes, sorry, I checked with PostgreSQL.

When Trac project has PostgreSQL backend, these queries will run.

create table xxx (aaa char);
commit;
select * from pg_tables
delete from session;
commit;
select * from session

comment:3 by John Hampton, 17 years ago

I'm +1 for the patch. While one should trust the users that they give REPORT_MODIFY privs to, it is not unwise to prevent the possible damage

comment:4 by Christian Boos, 17 years ago

Owner: changed from Matthew Good to Christian Boos
Status: newassigned
Summary: Suppless bad SQL in TracReportsSuppress bad SQL in TracReports

comment:5 by John Hampton, 17 years ago

Milestone: 0.11
Resolution: wontfix
Status: assignedclosed
Version: 0.8.4

Closing the ticket as won't fix after discussion with athomas and nkantrowitz. While the patch will catch some of the cases, it won't catch all of them. In order to catch all of the cases where a report could have bad SQL would require a full SQL parser and hence is not feasible. The consensus is that a half-implementation is worse than no implementation at all. The fact remains that if you give your users REPORT_MODIFY or REPORT_ADMIN perms, you need to trust those users to not screw up.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.