Files
codeql/javascript/ql/lib/semmle/javascript/internal/flow_summaries/JsonStringify.qll
2026-01-26 12:40:21 +01:00

23 lines
772 B
Plaintext

/**
* Contains implicit read steps at the input to any function that converts a deep object to a string, such as `JSON.stringify`.
*/
overlay[local?]
module;
private import javascript
private import FlowSummaryUtil
private import semmle.javascript.dataflow.internal.AdditionalFlowInternal
private import semmle.javascript.dataflow.FlowSummary
private class JsonStringifySummary extends SummarizedCallable::Range {
JsonStringifySummary() { this = "JSON.stringify" }
override DataFlow::InvokeNode getACall() { result instanceof JsonStringifyCall }
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
preservesValue = false and
input = ["Argument[0]", "Argument[0].AnyMemberDeep"] and
output = "ReturnValue"
}
}