Remove Shellwords sanitizer in ql

Note that some sanitizers had no effect because flow through those functions wasn't modeled.
This commit is contained in:
Owen Mansel-Chan
2026-02-17 12:39:07 +00:00
parent 4aee99f0eb
commit 6294c3b3b8
2 changed files with 9 additions and 12 deletions

View File

@@ -42,18 +42,6 @@ module CommandInjection {
SystemCommandExecutionSink() { exists(SystemCommandExecution c | c.isShellInterpreted(this)) }
}
/**
* A call to `Shellwords.escape` or `Shellwords.shellescape` sanitizes its input.
*/
class ShellwordsEscapeAsSanitizer extends Sanitizer {
ShellwordsEscapeAsSanitizer() {
this = API::getTopLevelMember("Shellwords").getAMethodCall(["escape", "shellescape"])
or
// The method is also added as `String#shellescape`.
this.(DataFlow::CallNode).getMethodName() = "shellescape"
}
}
private class ExternalCommandInjectionSink extends Sink {
ExternalCommandInjectionSink() { ModelOutput::sinkNode(this, "command-injection") }
}