Menu

#48 Allow text-literal variables to avoid injection attacks

open
nobody
security (1)
5
2016-06-24
2016-06-24
No

At present, there is no means to substitute literal text into the query component of an "xmlstarlet ed" command which is immune to injection. Consider, as an example:

xmlstarlet ed \ --var key '"Application/Foo" or 1=1' \ -u '//name[.=$key]/following-sibling::value[1]' \ -v 'bar'

Because the literal string in $key can contain content which is interpreted as XPath text ("or 1=1"), it's able to match all name elements, as opposed to only those containing strings matching a specific known value.

A --string-var alternative to --var, which passes the value given as a literal string, would be an effective way to address this need.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.