mirror of
https://github.com/github/codeql.git
synced 2026-04-24 16:25:15 +02:00
rename ProcessEnvLabel to PartiallySensitiveMap
This commit is contained in:
@@ -35,8 +35,8 @@ module CleartextLogging {
|
||||
override predicate isSanitizer(DataFlow::Node node) { node instanceof Barrier }
|
||||
|
||||
override predicate isSanitizerEdge(DataFlow::Node pred, DataFlow::Node succ, DataFlow::FlowLabel lbl) {
|
||||
// Only unknown property reads on `process.env` propagate taint.
|
||||
(not lbl instanceof ProcessEnvLabel or exists(succ.(DataFlow::PropRead).getPropertyName())) and
|
||||
// Only unknown property reads on sensitive objects propagate taint.
|
||||
(not lbl instanceof PartiallySensitiveMap or exists(succ.(DataFlow::PropRead).getPropertyName())) and
|
||||
succ.(DataFlow::PropRead).getBase() = pred
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ module CleartextLogging {
|
||||
DataFlow::Node src, DataFlow::Node trg, DataFlow::FlowLabel inlbl, DataFlow::FlowLabel outlbl
|
||||
) {
|
||||
trg.(DataFlow::PropRead).getBase() = src and
|
||||
inlbl instanceof ProcessEnvLabel and
|
||||
inlbl instanceof PartiallySensitiveMap and
|
||||
outlbl.isData()
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ module CleartextLogging {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** An access to the sensitive object `process.env`. */
|
||||
class ProcessEnvSource extends Source {
|
||||
ProcessEnvSource() {
|
||||
this = NodeJSLib::process().getAPropertyRead("env")
|
||||
@@ -173,11 +173,16 @@ module CleartextLogging {
|
||||
|
||||
override DataFlow::FlowLabel getLabel() {
|
||||
result.isData() or
|
||||
result instanceof ProcessEnvLabel
|
||||
result instanceof PartiallySensitiveMap
|
||||
}
|
||||
}
|
||||
class ProcessEnvLabel extends DataFlow::FlowLabel{
|
||||
ProcessEnvLabel() {
|
||||
|
||||
/**
|
||||
* A flow label describing a map that might contain sensitive information in some properties.
|
||||
* Property reads on such maps where the property name is fixed is unlikely to leak sensitive information.
|
||||
*/
|
||||
class PartiallySensitiveMap extends DataFlow::FlowLabel {
|
||||
PartiallySensitiveMap() {
|
||||
this = "processEnv"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user