Page MenuHomePhabricator

Support %LA (AND), %LO (OR) and %LQ (comma) conversions for qsprintf() to improve safety
ClosedPublic

Authored by epriestley on Nov 7 2018, 12:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 29, 12:20 PM
Unknown Object (File)
Wed, May 28, 2:42 PM
Unknown Object (File)
Sat, May 10, 8:03 AM
Unknown Object (File)
Tue, May 6, 7:31 AM
Unknown Object (File)
Apr 29 2025, 12:47 AM
Unknown Object (File)
Apr 27 2025, 3:54 AM
Unknown Object (File)
Apr 26 2025, 7:26 AM
Unknown Object (File)
Apr 25 2025, 12:26 PM
Subscribers
None

Details

Summary

Depends on D19782. Ref T13217. Ref T13216. Ref T6960. We currently construct some queries by passing implode(...) directly to qsprintf().

I believe we can cover all these cases (or, at least, almost all these cases) with conversions for imploding on AND, OR, or comma. This will ultimately let us make %Q safer.

Test Plan

Played around with these in a toy qsprintf() script; upcoming changes will convert Phabricator callsites more aggressively.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable