Opened 4 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#36778 closed Cleanup/optimization (fixed)

Extend admonition to avoid constructing query expressions from unsanitized user input

Reported by: Jacob Walls Owned by: Jacob Walls
Component: Documentation Version: dev
Severity: Normal Keywords: Func, sql, injection, extra, rawsql
Cc: Simon Charette, Michael Manfre 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

The Security Team occasionally receives reports where a proof of concept pipes unsanitized user input directly to a query expression argument traditionally regarded as statically configured and thus developer-controlled.

We haven't accepted these as vulnerabilities, because each case we've confronted has a clear domain to validate (e.g. positive integers) that a garden-variety form or serializer would handle, as opposed to anything that would require the db adapter to escape.

We have this clearly documented in the Func API where positional arguments can be user-driven but keyword arguments get interpolated directly into SQL (beware!), but this is potentially muddled by the inconsistency where some subclasses allow positional arguments for convenience but then pass that on to Func() via keyword (beware!)

Working on a way to clarify this in the Func docs and cross-link from the security reporting guidelines.

Change History (8)

comment:1 by Natalia Bidart, 4 weeks ago

Keywords: extra rawsql added
Triage Stage: UnreviewedAccepted
Version: dev

comment:2 by Natalia Bidart, 4 weeks ago

Thank you!

comment:3 by Jacob Walls, 4 weeks ago

Has patch: set

comment:4 by Jacob Walls, 3 weeks ago

Patch needs improvement: set

comment:5 by Jacob Walls, 3 weeks ago

Patch needs improvement: unset

comment:6 by Clifford Gama, 3 weeks ago

Triage Stage: AcceptedReady for checkin

comment:7 by Jacob Walls <jacobtylerwalls@…>, 3 weeks ago

Resolution: fixed
Status: assignedclosed

In 334308e:

Fixed #36778 -- Extended advice to sanitize input before using in query expressions.

Thanks Clifford Gama and Simon Charette for reviews.

comment:8 by Jacob Walls <jacobtylerwalls@…>, 3 weeks ago

In 189dcb1:

[6.0.x] Fixed #36778 -- Extended advice to sanitize input before using in query expressions.

Thanks Clifford Gama and Simon Charette for reviews.

Backport of 334308efae8e0c7b1523d5583af32b674a098eba from main.

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