ai-config-hidden-unicode-v1
3 rules · Keryn Software Licence · rules 0.8.0 · all packs
How to read a rule
- Severity
- How bad the finding is if it is real:
errorfails a default gate,warningandinfodo not. - Confidence
- P0 exploitable as written; P1 dangerous in context; P2 a heuristic or a posture check: confirm by reading the code.
- False-positive risk
- low: an exact API or flag, so hits are almost always real; medium: the pattern is legitimate in many programs, so check each hit; high: it finds a lead to confirm, so expect benign hits.
- Edge
- The relationship the finding sits on. reaches: content or traffic gets to a thing; calls: one thing invokes another; reads: one thing reads from another; writes: one thing writes to another; sends: data leaves for another party; grants: authority is given or left unchecked; depends_on: something relies on a component it does not verify; trusts: one party believes another without evidence. The boundary it crosses, when there is one: user->prompt (untrusted input reaching a prompt); model->code (model output reaching code, a shell, a query or a page); secret->outside (a secret leaving the trusted side); supply-chain (code, models or prompts pulled in from outside).
- Taxonomy chips
- References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.
seceng.aiconfig.invisible-unicode-character
Section titled “seceng.aiconfig.invisible-unicode-character”error generic agent-config, mcp, prompt-templates, openapi
This AI configuration or prompt file contains invisible Unicode (zero-width space, word joiner, invisible operators, Unicode tag characters U+E0000-U+E007F, variation selectors supplement). The model reads these code points while a reviewer sees nothing, which is how hidden instructions and spoofed server or tool names are smuggled into configs, prompts and API specs. Strip them.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
CWE-116 CWE-451 CWE-1007 LLM01 ASI01 ASI04
Fix: Delete the invisible characters, diff the file against a known-good copy to find any text they encoded, and block these code points in CI for every file an agent loads. Emoji ZWJ (U+200D) and a leading BOM are intentionally not flagged.
References: https://genai.owasp.org/llmrisk/llm01-prompt-injection/ · https://www.unicode.org/charts/PDF/UE0000.pdf · https://www.unicode.org/reports/tr39/
seceng.aiconfig.bidi-override-character
Section titled “seceng.aiconfig.bidi-override-character”error generic agent-config, mcp, prompt-templates, openapi
This AI configuration or prompt file contains Unicode bidirectional control characters (U+202A-U+202E, U+2066-U+2069). They reorder the displayed text so a reviewer reads something other than what the model, the MCP client or the Actions runtime ingests (a server name, a URL, an instruction). Strip them.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
CWE-116 CWE-451 CWE-1007 LLM01 ASI01 ASI04
Fix: Remove all bidirectional control characters and add a CI check (for example grep -P for the code points) so they cannot be reintroduced in any file an agent loads.
References: https://genai.owasp.org/llmrisk/llm01-prompt-injection/ · https://www.unicode.org/reports/tr9/
seceng.aiconfig.escaped-invisible-unicode
Section titled “seceng.aiconfig.escaped-invisible-unicode”error generic agent-config, mcp, json, openapi
This JSON or YAML AI configuration spells an invisible or direction-overriding Unicode code point as an escape sequence (, , , , or the \udb40\udcXX surrogate pair of a Unicode tag character). The file bytes are plain ASCII, so byte-level scanners and reviewers see nothing, but every JSON parser decodes the escape and the model, MCP client or Actions runtime receives the hidden character. Remove the escape.
Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.
Edge inspected: grants authority is given or left unchecked.
CWE-116 CWE-451 CWE-1007 LLM01 ASI01 ASI04
Fix: Delete the escape sequences (and the character they would decode to), review what the decoded text would have told the model, and lint agent-facing JSON and YAML for these escapes in CI.
References: https://genai.owasp.org/llmrisk/llm01-prompt-injection/ · https://www.unicode.org/charts/PDF/UE0000.pdf · https://www.rfc-editor.org/info/rfc8259/#section-7