Class BuiltInMatchers
java.lang.Object
com.tnsai.quality.security.harness.BuiltInMatchers
Factory for the framework's built-in CWE matchers (TNS-291).
Each matcher targets one CWE with a small set of conservative
regexes — the goal is "candidate signal for an agent", not "definitive
vulnerability proof". Expect false positives; the process stage
with a ReviewAgentSpi weeds them out.
Patterns favour the most common idioms in mainstream languages (Java, Python, JavaScript / TypeScript, plus a couple more for language-portable matchers like hardcoded-secrets). Adding more languages is a pure additive change inside the relevant pattern list.
- Since:
- 0.10.0 (TNS-291)
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<MatcherSpi> all()Convenience — every shipped matcher in a stable order.static MatcherSpiCWE-78 — OS command injection.static MatcherSpiCWE-79 — Cross-site scripting via unsafe innerHTML / unescaped output.static MatcherSpiCWE-95 — eval() / exec() of user-controlled input.static MatcherSpiCWE-798 — Hardcoded credentials (API keys, tokens, passwords).static MatcherSpiCWE-22 — Path traversal in file / FS operations.static MatcherSpiCWE-918 — Server-side request forgery via user-controlled URL.static MatcherSpiCWE-89 — SQL injection via raw string concatenation in queries.static MatcherSpiCWE-502 — Unsafe deserialisation (Java ObjectInputStream, pickle, yaml).static MatcherSpiCWE-327 — Use of weak / broken cryptographic algorithms.static MatcherSpiCWE-611 — XML External Entity expansion (XXE).
-
Method Details
-
sqlInjection
CWE-89 — SQL injection via raw string concatenation in queries. -
pathTraversal
CWE-22 — Path traversal in file / FS operations. -
commandInjection
CWE-78 — OS command injection. -
hardcodedSecrets
CWE-798 — Hardcoded credentials (API keys, tokens, passwords). -
weakCrypto
CWE-327 — Use of weak / broken cryptographic algorithms. -
crossSiteScripting
CWE-79 — Cross-site scripting via unsafe innerHTML / unescaped output. -
unsafeDeserialization
CWE-502 — Unsafe deserialisation (Java ObjectInputStream, pickle, yaml). -
serverSideRequestForgery
CWE-918 — Server-side request forgery via user-controlled URL. -
xmlExternalEntity
CWE-611 — XML External Entity expansion (XXE). -
evalOnInput
CWE-95 — eval() / exec() of user-controlled input. -
all
Convenience — every shipped matcher in a stable order.
-