Skip to content

Instantly share code, notes, and snippets.

@inkz
Created October 18, 2021 08:24
Show Gist options
  • Save inkz/14827f602ba896d0661a40a07ffaa1e8 to your computer and use it in GitHub Desktop.
Save inkz/14827f602ba896d0661a40a07ffaa1e8 to your computer and use it in GitHub Desktop.
rules:
- id: java-spring-sink-source
mode: taint
pattern-sinks:
- pattern: |
$SINK(...)
pattern-sources:
- patterns:
- pattern: $VAR
- pattern-either:
- pattern-inside: |
$TYPE $FUNC(..., @RequestParam(...) $T $VAR, ...) {
...
}
- pattern-inside: |
$TYPE $FUNC(..., @RequestHeader(...) $T $VAR, ...) {
...
}
- pattern-inside: |
$TYPE $FUNC(..., @CookieValue(...) $T $VAR, ...) {
...
}
- pattern-inside: |
$TYPE $FUNC(..., @RequestAttribute(...) $T $VAR, ...) {
...
}
- pattern-inside: |
$TYPE $FUNC(..., @RequestBody(...) $T $VAR, ...) {
...
}
message: |
sink found
languages: [java]
severity: ERROR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment