Merge pull request #13163 from geoffw0/cleartextlogging

Swift: Make the cleartext logging query consistent with other cleartext-* queries.
This commit is contained in:
Geoffrey White
2023-05-23 14:14:56 +01:00
committed by GitHub

View File

@@ -6,7 +6,7 @@
* @problem.severity error
* @security-severity 7.5
* @precision high
* @id swift/clear-text-logging
* @id swift/cleartext-logging
* @tags security
* external/cwe/cwe-312
* external/cwe/cwe-359
@@ -18,7 +18,9 @@ import codeql.swift.dataflow.DataFlow
import codeql.swift.security.CleartextLoggingQuery
import CleartextLoggingFlow::PathGraph
from CleartextLoggingFlow::PathNode src, CleartextLoggingFlow::PathNode sink
where CleartextLoggingFlow::flowPath(src, sink)
select sink.getNode(), src, sink, "This $@ is written to a log file.", src.getNode(),
"potentially sensitive information"
from CleartextLoggingFlow::PathNode source, CleartextLoggingFlow::PathNode sink
where CleartextLoggingFlow::flowPath(source, sink)
select sink.getNode(), source, sink,
"This operation writes '" + sink.toString() +
"' to a log file. It may contain unencrypted sensitive data from $@.", source,
source.getNode().toString()