add taint step through the ansi-colors library

This commit is contained in:
Erik Krogh Kristensen
2021-06-22 22:47:58 +02:00
parent d719a1e627
commit a21ebbbe8f
4 changed files with 47 additions and 0 deletions

View File

@@ -201,3 +201,15 @@ private class DebugLoggerCall extends LoggerCall, API::CallNode {
override DataFlow::Node getAMessageComponent() { result = getAnArgument() }
}
/**
* A step through the [`ansi-colors`](https://https://npmjs.org/package/ansi-colors) library.
*/
class AnsiColorsStep extends TaintTracking::SharedTaintStep {
override predicate stringManipulationStep(DataFlow::Node pred, DataFlow::Node succ) {
exists(API::CallNode call | call = API::moduleImport("ansi-colors").getAMember*().getACall() |
pred = call.getArgument(0) and
succ = call
)
}
}