io.codemodder.codemods.harden-xmlinputfactory.yaml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-codemods Show documentation
Show all versions of core-codemods Show documentation
Codemods for fixing common errors across many Java projects
rules:
- id: harden-xmlinputfactory
patterns:
- pattern-either:
- pattern: $XMLF = XMLInputFactory.newInstance(...)
- pattern: $XMLF = XMLInputFactory.newFactory(...)
- pattern-not-inside: |
$RT $METHOD ($ARGS) {
...
XMLInputFactorySecurity.hardenFactory($XMLF);
...
}
- pattern-not-inside: |
$RT $METHOD ($ARGS) {
...
io.github.pixee.security.XMLInputFactorySecurity.hardenFactory(...);
...
}
- focus-metavariable: $XMLF
message: Semgrep found a match
languages:
- java
severity: WARNING