Merge pull request #13841 from jeongsoolee09/log-injection-mad

JS: Add support for log injection in MaD
This commit is contained in:
Asger F
2023-08-01 13:09:56 +02:00
committed by GitHub
3 changed files with 9 additions and 0 deletions

View File

@@ -471,6 +471,7 @@ Unlike sources, sinks tend to be highly query-specific, rarely affecting more th
- **request-forgery**: A sink that controls the URL of a request, such as in a **fetch** call.
- **url-redirection**: A sink that can be used to redirect the user to a malicious URL.
- **unsafe-deserialization**: A deserialization sink that can lead to code execution or other unsafe behaviour, such as an unsafe YAML parser.
- **log-injection**: A sink that can be used for log injection, such as in a **console.log** call.
Summary kinds
~~~~~~~~~~~~~

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Added `log-injection` as a customizable sink kind for log injection.

View File

@@ -66,3 +66,7 @@ class HtmlSanitizer extends Sanitizer instanceof HtmlSanitizerCall { }
class JsonStringifySanitizer extends Sanitizer {
JsonStringifySanitizer() { this = any(JsonStringifyCall c).getOutput() }
}
private class SinkFromModel extends Sink {
SinkFromModel() { this = ModelOutput::getASinkNode("log-injection").asSink() }
}