mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
add taint step through the colors library
This commit is contained in:
@@ -213,3 +213,18 @@ class AnsiColorsStep extends TaintTracking::SharedTaintStep {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A step through the [`colors`](https://npmjs.org/package/colors) library.
|
||||
* This step ignores the `String.prototype` modifying part of the `colors` library.
|
||||
*/
|
||||
class ColorsStep extends TaintTracking::SharedTaintStep {
|
||||
override predicate stringManipulationStep(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(API::CallNode call |
|
||||
call = API::moduleImport(["colors", "colors/safe"]).getAMember*().getACall()
|
||||
|
|
||||
pred = call.getArgument(0) and
|
||||
succ = call
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user