Documentation Index
Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
Use this file to discover all available pages before exploring further.
- Constant propagation allows Semgrep to, for example, match
return 42againstreturn xwhenxcan be reduced to42by constant folding. There is also a specific experimental feature of Constant propagation, called Symbolic propagation. - Taint tracking (known also as taint analysis) enables you to write simple rules that catch complex injection bugs, such as those that can result in cross-site scripting (XSS).
INFOEnsure that you understand the design trade-offs and limitations of the dataflow engine. For further details, see dataflow status.
Design trade-offs
Semgrep strives for simplicity and offers lightweight and fast static analyses. In addition to being intraprocedural, here are some other trade-offs:- No path sensitivity: All potential execution paths are considered, even though some may not be feasible.
- No pointer or shape analysis: Aliasing that happens in non-trivial ways may not be detected, such as through arrays or pointers. Individual elements in arrays or other data structures are not tracked. The dataflow engine supports limited field sensitivity for taint tracking, but not for constant propagation.
- No soundness guarantees: Semgrep ignores the effects of
eval-like functions on the program state. It doesn’t make worst-case sound assumptions, but rather “reasonable” ones.