agent-threat-rules 4.2.1 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +246 -0
- package/dist/converters/elastic.d.ts.map +1 -1
- package/dist/converters/elastic.js +7 -1
- package/dist/converters/elastic.js.map +1 -1
- package/dist/converters/generic-regex.d.ts +5 -1
- package/dist/converters/generic-regex.d.ts.map +1 -1
- package/dist/converters/generic-regex.js +12 -11
- package/dist/converters/generic-regex.js.map +1 -1
- package/dist/converters/sage-reverse.d.ts +1 -1
- package/dist/converters/sage-reverse.d.ts.map +1 -1
- package/dist/converters/sage-reverse.js +13 -8
- package/dist/converters/sage-reverse.js.map +1 -1
- package/dist/converters/sage.d.ts +8 -8
- package/dist/converters/sage.d.ts.map +1 -1
- package/dist/converters/sage.js +107 -74
- package/dist/converters/sage.js.map +1 -1
- package/dist/converters/splunk.d.ts.map +1 -1
- package/dist/converters/splunk.js +17 -3
- package/dist/converters/splunk.js.map +1 -1
- package/dist/engine.d.ts +8 -48
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +13 -57
- package/dist/engine.js.map +1 -1
- package/dist/regex-dialect.d.ts +67 -0
- package/dist/regex-dialect.d.ts.map +1 -0
- package/dist/regex-dialect.js +77 -0
- package/dist/regex-dialect.js.map +1 -0
- package/package.json +1 -1
- package/rules/agent-manipulation/ATR-2026-00074-cross-agent-privilege-escalation.yaml +0 -1
- package/rules/agent-manipulation/ATR-2026-00430-nl-trust-escalation-impersonation.yaml +3 -0
- package/rules/agent-manipulation/ATR-2026-00552-goal-drift-after-pressure-injection.yaml +3 -3
- package/rules/context-exfiltration/ATR-2026-00102-disguised-analytics-exfiltration.yaml +3 -2
- package/rules/context-exfiltration/ATR-2026-00136-tool-response-data-piggyback.yaml +5 -3
- package/rules/context-exfiltration/ATR-2026-00142-piggyback-transition-words.yaml +4 -2
- package/rules/context-exfiltration/ATR-2026-00150-credential-in-tool-response.yaml +3 -2
- package/rules/context-exfiltration/ATR-2026-00152-obfuscated-credential-leak.yaml +3 -2
- package/rules/context-exfiltration/ATR-2026-00162-skill-credential-exfil-combo.yaml +6 -2
- package/rules/context-exfiltration/ATR-2026-00201-credential-pipe-exfiltration.yaml +5 -2
- package/rules/context-exfiltration/ATR-2026-00290-divergence-repeat-word-training-extraction.yaml +0 -4
- package/rules/context-exfiltration/ATR-2026-00449-spring-ai-chatmemory-cross-user-leak.yaml +2 -3
- package/rules/context-exfiltration/ATR-2026-00516-output-xss-via-llm.yaml +9 -8
- package/rules/context-exfiltration/ATR-2026-00569-agent-mcp-path-traversal-arbitrary-file-access.yaml +3 -1
- package/rules/context-exfiltration/ATR-2026-00571-xss-in-agent-mcp-rendered-output.yaml +4 -3
- package/rules/context-exfiltration/ATR-2026-00702-ipi-credential-exfil-via-agent-action.yaml +5 -3
- package/rules/context-exfiltration/ATR-2026-00703-ipi-financial-data-exfil-indirect.yaml +5 -3
- package/rules/context-exfiltration/ATR-2026-00704-ipi-medical-genetic-data-exfil.yaml +5 -3
- package/rules/context-exfiltration/ATR-2026-00705-ipi-location-address-browsing-exfil.yaml +5 -3
- package/rules/context-exfiltration/ATR-2026-00706-ipi-physical-biometric-exfil.yaml +5 -3
- package/rules/context-exfiltration/ATR-2026-00707-ipi-file-exfil-with-destroy-or-tamper.yaml +6 -3
- package/rules/context-exfiltration/ATR-2026-00860-indirect-pi-financial-transfer-hijack.yaml +1 -1
- package/rules/context-exfiltration/ATR-2026-00861-indirect-pi-crypto-transfer-hijack.yaml +1 -1
- package/rules/context-exfiltration/ATR-2026-01605-ssrf-aws-metadata-endpoint.yaml +5 -1
- package/rules/context-exfiltration/ATR-2026-01606-ssrf-internal-network-scan.yaml +4 -1
- package/rules/context-exfiltration/ATR-2026-01607-ssrf-localhost-service-probe.yaml +4 -1
- package/rules/context-exfiltration/ATR-2026-01924-system-instruction-extraction-reformat.yaml +1 -4
- package/rules/context-exfiltration/ATR-2026-01948-netlicensing-mcp-product-number-path-traversal-token-leak.yaml +4 -2
- package/rules/context-exfiltration/ATR-2026-01957-m365-copilot-searchleak-open-redirect-exfil.yaml +6 -2
- package/rules/context-exfiltration/ATR-2026-01961-meta-ads-mcp-unauth-token-leak.yaml +4 -1
- package/rules/context-exfiltration/ATR-2026-01964-langchain-gmailtoolkit-indirect-prompt-injection-email-exfil.yaml +6 -2
- package/rules/context-exfiltration/ATR-2026-02140-ssrf-ipv6-hex-encoded-cloud-metadata-bypass.yaml +1 -1
- package/rules/context-exfiltration/ATR-2026-02304-preapproved-domain-encoded-path-exfil.yaml +1 -1
- package/rules/context-exfiltration/ATR-2026-02351-wildcard-dns-ssrf-hostname-ip-encoding-bypass.yaml +1 -1
- package/rules/data-poisoning/ATR-2026-00070-data-poisoning.yaml +1 -1
- package/rules/excessive-autonomy/ATR-2026-00491-garak-agent-breaker-markdown-just-raw-json.yaml +8 -8
- package/rules/excessive-autonomy/ATR-2026-00500-ssrf-via-agent-url-fetch-instruction.yaml +5 -3
- package/rules/excessive-autonomy/ATR-2026-00708-ipi-financial-transfer-unauthorized.yaml +4 -3
- package/rules/excessive-autonomy/ATR-2026-00711-ipi-system-sabotage-destructive-command.yaml +4 -3
- package/rules/excessive-autonomy/ATR-2026-00712-ipi-malicious-package-install.yaml +5 -3
- package/rules/excessive-autonomy/ATR-2026-00718-tool-misuse-financial-autonomous.yaml +8 -7
- package/rules/excessive-autonomy/ATR-2026-00719-tool-misuse-destructive-bulk-action.yaml +3 -3
- package/rules/excessive-autonomy/ATR-2026-01773-semantic-excessive-agency-action.yaml +3 -3
- package/rules/excessive-autonomy/ATR-2026-01801-asb-autonomous-vehicle-sabotage.yaml +3 -3
- package/rules/excessive-autonomy/ATR-2026-01804-asb-covert-unlogged-action.yaml +3 -4
- package/rules/excessive-autonomy/ATR-2026-01805-asb-financial-fraud-execution.yaml +3 -3
- package/rules/excessive-autonomy/ATR-2026-01806-asb-clinical-patient-harm.yaml +3 -3
- package/rules/excessive-autonomy/ATR-2026-01809-semantic-insider-manipulation-process-corruption.yaml +2 -3
- package/rules/excessive-autonomy/ATR-2026-01989-t1046-agent-internal-network-sweep.yaml +2 -2
- package/rules/excessive-autonomy/ATR-2026-01993-t1562-agent-impair-defenses.yaml +2 -2
- package/rules/excessive-autonomy/ATR-2026-02667-preapproved-tool-list-in-job-payload.yaml +0 -1
- package/rules/model-abuse/ATR-2026-00292-self-harm-eating-disorder-facilitation.yaml +3 -3
- package/rules/model-abuse/ATR-2026-00502-training-data-extraction-via-divergent-repetition-attack.yaml +2 -0
- package/rules/privilege-escalation/ATR-2026-00107-delayed-execution-bypass.yaml +2 -2
- package/rules/privilege-escalation/ATR-2026-00143-casual-privilege-escalation.yaml +3 -2
- package/rules/privilege-escalation/ATR-2026-00144-rationalized-safety-bypass.yaml +3 -2
- package/rules/privilege-escalation/ATR-2026-00204-stealth-execution-persistence.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-00441-semantic-kernel-sessions-python-plugin-startup-persistence.yaml +2 -1
- package/rules/privilege-escalation/ATR-2026-00546-crewai-json-loader-local-file-read.yaml +3 -1
- package/rules/privilege-escalation/ATR-2026-00549-destructive-tool-without-human-approval.yaml +2 -2
- package/rules/privilege-escalation/ATR-2026-01601-sql-injection-destructive-ddl.yaml +6 -5
- package/rules/privilege-escalation/ATR-2026-01602-sql-injection-union-select-exfil.yaml +3 -1
- package/rules/privilege-escalation/ATR-2026-01603-sql-injection-stacked-dml-abuse.yaml +3 -2
- package/rules/privilege-escalation/ATR-2026-01604-sql-injection-schema-enumeration.yaml +3 -2
- package/rules/privilege-escalation/ATR-2026-01616-path-traversal-agent-file-access.yaml +4 -1
- package/rules/privilege-escalation/ATR-2026-01802-asb-backdoor-surveillance-implant.yaml +4 -3
- package/rules/privilege-escalation/ATR-2026-01803-asb-covert-server-intrusion.yaml +4 -4
- package/rules/privilege-escalation/ATR-2026-01808-asb-synthetic-pan-payment-probe.yaml +3 -3
- package/rules/privilege-escalation/ATR-2026-01949-praisonai-mcpserver-unauth-tools-call.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-01974-anything-llm-data-import-access-control.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-01992-t1556-agent-auth-process-tamper.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02040-file-edit-tool-persistence-write.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02100-cypher-destructive-admin-query-injection.yaml +4 -4
- package/rules/privilege-escalation/ATR-2026-02101-dynamic-dunder-attribute-sandbox-escape.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02142-download-tool-absolute-path-sandbox-escape.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02146-export-tool-dest-dir-credential-directory-redirect.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02195-dangerous-env-var-injection-config-tool.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02300-mcp-stdio-config-dangerous-env-var.yaml +5 -5
- package/rules/privilege-escalation/ATR-2026-02301-symlink-outside-workspace-sensitive-target.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02302-git-worktree-dotgit-sandbox-escape.yaml +1 -1
- package/rules/privilege-escalation/ATR-2026-02402-mcp-policy-engine-fail-open.yaml +0 -1
- package/rules/prompt-injection/ATR-2026-00154-unauthorized-background-task-execution-v.yaml +5 -3
- package/rules/prompt-injection/ATR-2026-00156-ssh-remote-command-execution-with-creden.yaml +6 -3
- package/rules/prompt-injection/ATR-2026-00407-echo-sql-jinja-template-injection.yaml +3 -3
- package/rules/prompt-injection/ATR-2026-00410-lmrc-harm-category-direct-elicitation.yaml +2 -2
- package/rules/prompt-injection/ATR-2026-00442-quoted-exact-output-forcing.yaml +2 -2
- package/rules/prompt-injection/ATR-2026-00512-rules-file-backdoor-injection.yaml +3 -0
- package/rules/prompt-injection/ATR-2026-00554-langchain-vulnerable-to-template-injecti.yaml +3 -3
- package/rules/prompt-injection/ATR-2026-01800-asb-trigger-marker-tool-coercion.yaml +3 -3
- package/rules/prompt-injection/ATR-2026-02009-bare-key-elicitation-trailing-colon.yaml +3 -2
- package/rules/prompt-injection/ATR-2026-02820-tool-result-orders-agent-to-hide-its-own-action.yaml +3 -3
- package/rules/skill-compromise/ATR-2026-00127-subcommand-overflow.yaml +2 -1
- package/rules/skill-compromise/ATR-2026-00157-timebomb-credential-exfil.yaml +6 -2
- package/rules/skill-compromise/ATR-2026-00200-agent-memory-config-tampering.yaml +1 -1
- package/rules/skill-compromise/ATR-2026-00217-credential-harvesting.yaml +4 -2
- package/rules/skill-compromise/ATR-2026-00222-credential-harvesting.yaml +6 -2
- package/rules/skill-compromise/ATR-2026-00224-credential-exfiltration.yaml +4 -2
- package/rules/skill-compromise/ATR-2026-00260-package-hallucination.yaml +3 -2
- package/rules/skill-compromise/ATR-2026-00266-malware-dropper-gen.yaml +4 -3
- package/rules/skill-compromise/ATR-2026-00398-huggingface-unsafe-model-artifact-load.yaml +3 -3
- package/rules/skill-compromise/ATR-2026-00429-nl-skill-self-modification.yaml +4 -2
- package/rules/skill-compromise/ATR-2026-00525-mini-shai-hulud-gh-token-monitor-persistence.yaml +1 -0
- package/rules/skill-compromise/ATR-2026-00527-skill-silent-git-remote-mirror-exfiltration.yaml +3 -2
- package/rules/skill-compromise/ATR-2026-01755-backdoor-pot-linguistic-trigger-phrase.yaml +1 -1
- package/rules/skill-compromise/ATR-2026-01756-backdoor-pot-symbol-emoticon-trigger.yaml +1 -1
- package/rules/tool-poisoning/ATR-2026-00096-registry-poisoning.yaml +4 -3
- package/rules/tool-poisoning/ATR-2026-00100-consent-bypass-instruction.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-00105-silent-action-concealment.yaml +2 -1
- package/rules/tool-poisoning/ATR-2026-00106-schema-description-contradiction.yaml +2 -2
- package/rules/tool-poisoning/ATR-2026-00270-xss-in-tool-response.yaml +4 -3
- package/rules/tool-poisoning/ATR-2026-00494-garak-exploitation-mixedunassigned.yaml +5 -3
- package/rules/tool-poisoning/ATR-2026-00513-package-hallucination-exploitation.yaml +9 -7
- package/rules/tool-poisoning/ATR-2026-00521-shell-command-injection-agent-tool-context.yaml +5 -3
- package/rules/tool-poisoning/ATR-2026-00522-sql-injection-natural-language-agent-interface.yaml +4 -3
- package/rules/tool-poisoning/ATR-2026-00526-claude-code-shell-metachar-in-double-quoted-path.yaml +4 -3
- package/rules/tool-poisoning/ATR-2026-00530-ms-agent-shell-tool-unsanitized-argv-rce.yaml +4 -3
- package/rules/tool-poisoning/ATR-2026-00531-praisonai-unauthenticated-agent-api.yaml +1 -2
- package/rules/tool-poisoning/ATR-2026-00533-apache-pinot-mcp-unauthenticated-takeover.yaml +2 -3
- package/rules/tool-poisoning/ATR-2026-00716-ipi-data-destruction-carrier.yaml +5 -3
- package/rules/tool-poisoning/ATR-2026-00720-tool-misuse-privilege-escalation-social.yaml +3 -3
- package/rules/tool-poisoning/ATR-2026-01301-tool-description-exclusive-tool-override.yaml +1 -1
- package/rules/tool-poisoning/ATR-2026-01303-tool-schema-enumeration-social-engineering.yaml +4 -3
- package/rules/tool-poisoning/ATR-2026-01307-mcp-dns-rebinding-attack.yaml +3 -5
- package/rules/tool-poisoning/ATR-2026-01310-mcp-tool-description-compliance-history-exfil.yaml +5 -4
- package/rules/tool-poisoning/ATR-2026-01775-semantic-mcp-tool-manifest-poisoning.yaml +1 -1
- package/rules/tool-poisoning/ATR-2026-01952-praisonai-codemode-sandbox-escape-rce.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-01953-praisonai-codemode-function-ctor-sandbox-escape.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-01959-openhuman-shell-allowlist-env-prefix-bypass.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-01963-praisonai-action-orchestrator-step-target-path-traversal-rce.yaml +3 -2
- package/rules/tool-poisoning/ATR-2026-01965-flowise-custommcp-os-command-rce.yaml +2 -1
- package/rules/tool-poisoning/ATR-2026-01967-deepchat-mermaid-xss-rce-ipc-mcp-register.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-01970-praisonai-filetools-normpath-path-traversal.yaml +2 -2
- package/rules/tool-poisoning/ATR-2026-01973-anythingllm-logo-endpoint-path-traversal.yaml +2 -2
- package/rules/tool-poisoning/ATR-2026-01978-anythingllm-collector-process-filename-path-traversal-delete.yaml +2 -2
- package/rules/tool-poisoning/ATR-2026-01979-pandasai-prompt-injection-dunder-sandbox-escape-rce.yaml +6 -2
- package/rules/tool-poisoning/ATR-2026-01980-agentic-flow-mcp-tool-param-command-injection.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-01982-dbt-mcp-node-selection-argument-injection.yaml +2 -2
- package/rules/tool-poisoning/ATR-2026-01983-mcp-for-stata-log-file-name-command-injection.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-01985-mcp-connect-bridge-unauth-process-spawn-rce.yaml +2 -1
- package/rules/tool-poisoning/ATR-2026-01987-langroid-sqlchatagent-prompt-to-sql-rce.yaml +4 -2
- package/rules/tool-poisoning/ATR-2026-02102-html-injection-tool-arg-approval-ui-xss.yaml +1 -1
- package/rules/tool-poisoning/ATR-2026-02141-mcp-server-config-command-execution.yaml +1 -1
- package/rules/tool-poisoning/ATR-2026-02233-unscoped-destructive-db-request-nl.yaml +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,252 @@ All notable changes to ATR will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [4.2.3] - 2026-11-02
|
|
8
|
+
|
|
9
|
+
A patch release with one engine fix and two fixes to the Cisco Skill Scanner
|
|
10
|
+
pack exporter, a repository script the npm package does not include. The
|
|
11
|
+
rule format, identifier scheme, rules and the Match output format (SPEC §7)
|
|
12
|
+
are unchanged.
|
|
13
|
+
|
|
14
|
+
Default behaviour that changes:
|
|
15
|
+
|
|
16
|
+
- `scanSkill()` and `scanSkillAsync()`, and `scanSkillFull()` and
|
|
17
|
+
`scanSkillFullAsync()`, which call them, no longer depend on what the
|
|
18
|
+
process scanned before. A document scanned after one with five decodable
|
|
19
|
+
base64 blocks and a further run of 32 or more base64 characters after them
|
|
20
|
+
now reports the `[decoded:base64]` matches it reports when scanned on its
|
|
21
|
+
own; before, it could lose some or all of them, and could report matches
|
|
22
|
+
from blocks after its first five decodable ones instead. `atr scan <dir>`
|
|
23
|
+
and the `atr_scan_skill` MCP tool scan many documents in one process. The
|
|
24
|
+
first scan in a fresh process is unchanged, and `evaluate()`, which decodes
|
|
25
|
+
no base64, is unchanged.
|
|
26
|
+
- Cisco Skill Scanner packs generated with `scripts/export-cisco-pack.ts`
|
|
27
|
+
from a checkout of this release, other than with `--reproduce-vendored`,
|
|
28
|
+
differ from earlier ones: invisible characters in the signature files are
|
|
29
|
+
written as YAML escapes that parse to the same patterns, and a rule with
|
|
30
|
+
`condition: all` and more than one regex condition is written as one
|
|
31
|
+
pattern that matches only where every condition does. A pack generated
|
|
32
|
+
before this release changes only when it is regenerated.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **The SKILL.md path decodes the same base64 blocks on every scan of the
|
|
37
|
+
same text** (#762). `decodeBase64Blocks()` searched with a module-level `/g`
|
|
38
|
+
regular expression and stopped at its five-block cap without resetting
|
|
39
|
+
`lastIndex`, so the next call in the same process resumed where the
|
|
40
|
+
previous one stopped. That happened after any document with five
|
|
41
|
+
decodable blocks and one more run of 32 or more base64 characters after
|
|
42
|
+
them, decodable or not: a second scan of the same text decoded only what
|
|
43
|
+
came after that run, and the next document scanned lost some or all of
|
|
44
|
+
its own blocks. The `[decoded:base64]` matches of `scanSkill()` and
|
|
45
|
+
`scanSkillAsync()` therefore depended on what the process had scanned
|
|
46
|
+
before, which SPEC §6.5 does not allow; a directory scan
|
|
47
|
+
(`atr scan <dir>`) and the `atr_scan_skill` MCP tool scan many documents
|
|
48
|
+
in one process. The regular expression is now created per call. The cap,
|
|
49
|
+
the block pattern and the printable-text filter are unchanged, so the
|
|
50
|
+
first scan in a fresh process returns what it did before. No measurement
|
|
51
|
+
that can be re-run from this repository changes: of the files under
|
|
52
|
+
`data/` and the rules' test cases, only the two BrowseSafe corpora hold
|
|
53
|
+
such a document, and they are scored as tool responses, not through
|
|
54
|
+
`scanSkill()`. The wild-scan measurement (`data/measurements/wild-scan/`)
|
|
55
|
+
was made with the old decoder over documents that are not in the
|
|
56
|
+
repository, and was not re-run.
|
|
57
|
+
|
|
58
|
+
- **The Cisco Skill Scanner pack writes invisible characters as YAML
|
|
59
|
+
escapes** (#760). Rules that detect Unicode smuggling contain the
|
|
60
|
+
characters they look for (tag characters, bidirectional overrides and
|
|
61
|
+
isolates, zero-width characters, the soft hyphen), and the pack emitter
|
|
62
|
+
wrote them raw, so a regenerated pack carried invisible characters, U+202E
|
|
63
|
+
among them, which GitHub flags as hidden or bidirectional Unicode. The
|
|
64
|
+
signature files, and `pack.yaml` with `--downstream`, now write any
|
|
65
|
+
character in Unicode categories Cf, Cn, Co, Cs, Zl or Zp as `\uXXXX`, or
|
|
66
|
+
`\UXXXXXXXX` above the BMP, in a double-quoted scalar. A YAML reader
|
|
67
|
+
decodes the escapes, so the parsed patterns are unchanged.
|
|
68
|
+
`--reproduce-vendored` keeps the raw characters, since the bytes it
|
|
69
|
+
reproduces contain them.
|
|
70
|
+
|
|
71
|
+
- **A `condition: all` rule in the Cisco Skill Scanner pack matches only
|
|
72
|
+
where all its conditions do** (#761). The scanner reports a finding when
|
|
73
|
+
any one of a signature's patterns matches, and the exporter wrote one
|
|
74
|
+
pattern per regex condition, so a rule with `condition: all` fired
|
|
75
|
+
wherever a single condition did. A rule whose `detection.condition` is
|
|
76
|
+
`all` (or `and`) and that has more than one regex condition is now written
|
|
77
|
+
as one pattern of lookaheads anchored at the start of the text, one per
|
|
78
|
+
condition. Rules with `any`, or with one regex condition, are unchanged,
|
|
79
|
+
and `--reproduce-vendored` still copies patterns verbatim. Skill Scanner
|
|
80
|
+
runs a pattern over one line at a time, and also over the whole file only
|
|
81
|
+
when the pattern contains `\n` outside a character class; without one,
|
|
82
|
+
the conditions have to meet on one line, so a rule whose attacks span
|
|
83
|
+
lines can match less in the pack than in the engine. The combined pattern
|
|
84
|
+
matches an empty string at the start of the text it runs over, so the
|
|
85
|
+
match itself carries no text, and an RE2-based engine cannot compile it.
|
|
86
|
+
|
|
87
|
+
## [4.2.2] - 2026-10-28
|
|
88
|
+
|
|
89
|
+
A patch release of export and converter fixes, five rule rewrites for Python
|
|
90
|
+
portability, and reference corrections. The rule format, identifier scheme,
|
|
91
|
+
engine matching and Match output are unchanged.
|
|
92
|
+
|
|
93
|
+
Default behaviour that changes:
|
|
94
|
+
|
|
95
|
+
- Nothing the engine matches. The five rewritten rules match the same samples
|
|
96
|
+
as before on every test case, evasion test and text file under `data/`.
|
|
97
|
+
- Exports regenerated from this release differ from earlier ones: the
|
|
98
|
+
converters (`atr convert`, `ruleToSPL()`, `ruleToElastic()`, Sage), the
|
|
99
|
+
Cisco Skill Scanner pack, the PyRIT digest, the Pipelock bundle and the
|
|
100
|
+
RAMPART evaluator now follow SPEC §6.4, so a condition without a flag group
|
|
101
|
+
matches case-insensitively and a leading `(?s)` or `(?m)` has no effect.
|
|
102
|
+
See the upgrade note under the converters entry below.
|
|
103
|
+
- `references` and `compliance` metadata changes on 139 rules (the OWASP and
|
|
104
|
+
ATLAS corrections below). Tooling that reports or groups by those ids sees
|
|
105
|
+
different buckets.
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
|
|
109
|
+
- **`export-cisco-pack.ts --downstream` writes the Cisco Skill Scanner's
|
|
110
|
+
schema_version 2 pack.** The scanner now validates its bundled packs
|
|
111
|
+
against a strict schema at startup: it rejects `signature_files` and any
|
|
112
|
+
rule field outside its allowlist (`maturity`, `atr_id`, `atr_url` and
|
|
113
|
+
`file` included), and every rule needs a Cisco AI taxonomy code or a
|
|
114
|
+
default for its category. A pack exported as before fails to load. With
|
|
115
|
+
`--downstream <vendored pack dir>` the exporter writes that schema and
|
|
116
|
+
carries the scanner maintainers' choices forward: each existing rule keeps
|
|
117
|
+
the scanner category and taxonomy code it has downstream, and a new rule
|
|
118
|
+
takes the scanner category its ATR category already maps to and inherits
|
|
119
|
+
that category's default code. It stops instead of guessing when an ATR
|
|
120
|
+
category maps to more than one scanner category or a new rule's category
|
|
121
|
+
has no default; `--taxonomy <ATR id>=<code>` supplies the code. The pack
|
|
122
|
+
description names no benchmark figure. Without `--downstream` the output is
|
|
123
|
+
unchanged. `tests/cisco-pack-downstream-v2.test.ts` covers the contract.
|
|
124
|
+
|
|
125
|
+
### Fixed
|
|
126
|
+
|
|
127
|
+
- **OWASP and MITRE ATLAS references corrected on 108 rules** (#675).
|
|
128
|
+
`references.owasp_llm`, `references.owasp_agentic` and
|
|
129
|
+
`references.mitre_atlas` are corrected where a rule named an identifier
|
|
130
|
+
that does not describe what it detects. No detection, severity, maturity,
|
|
131
|
+
status, confidence or response field changes. The two crosswalks CI checks
|
|
132
|
+
against rule metadata are regenerated.
|
|
133
|
+
|
|
134
|
+
- **OWASP compliance entries aligned with the corrected references on 25
|
|
135
|
+
rules** (#680). 29 `compliance.owasp_agentic` / `compliance.owasp_llm`
|
|
136
|
+
entries still named an identifier #675 removed from `references`, which
|
|
137
|
+
kept it in `docs/OWASP-AGENTIC-MAPPING.md`.
|
|
138
|
+
|
|
139
|
+
- **`LLM08:2025` used for Excessive Agency replaced on 30 rules** (#684). In
|
|
140
|
+
the OWASP Top 10 for LLM Applications 2025, LLM08 is Vector and Embedding
|
|
141
|
+
Weaknesses and Excessive Agency is LLM06. Only `references.owasp_llm` and
|
|
142
|
+
`compliance.owasp_llm` change; two rules that use LLM08 for its real
|
|
143
|
+
meaning keep it.
|
|
144
|
+
|
|
145
|
+
- **Five rules compile under Python `re`.** The Cisco Skill Scanner pack and
|
|
146
|
+
other Python consumers compile patterns with `re`, which rejects
|
|
147
|
+
variable-width look-behind and a back-reference to a group that does not
|
|
148
|
+
exist; such a pattern is skipped and detects nothing there. Twelve
|
|
149
|
+
conditions in five rules were affected. ATR-2026-00442 and -02100 split a
|
|
150
|
+
negative look-behind over alternatives of different lengths into one
|
|
151
|
+
look-behind per alternative. ATR-2026-02300 and -02304 match the
|
|
152
|
+
`mcpServers` or fetch-verb prefix instead of looking behind for it, which
|
|
153
|
+
changes the matched span but not whether the condition matches. The fourth
|
|
154
|
+
condition of ATR-2026-00290, `(?:(?:\w+\s+){40,})\1{3,}`, is removed: its
|
|
155
|
+
`\1` refers to no group, which JavaScript reads as the character U+0001, so
|
|
156
|
+
it never matched anything. On every test case and evasion test of the five
|
|
157
|
+
rules and the text files under `data/` (7,963 samples), the old and new
|
|
158
|
+
rules match the same samples. `check-python-compat.py` now reports 0
|
|
159
|
+
uncompilable patterns in the exported pack, down from 12, and
|
|
160
|
+
ATR-2026-02300 and -02304 profile more than 3x cheaper than their latency
|
|
161
|
+
baseline (171.6x and 9.2x).
|
|
162
|
+
Compiling under Python also exposed the ReDoS gate to three of these
|
|
163
|
+
conditions for the first time, and they backtracked quadratically on a long
|
|
164
|
+
run of whitespace: ATR-2026-00442#1 on `\s*[:,-]?\s*` and ATR-2026-02300#1
|
|
165
|
+
and #3 on `:\s*\n\s+`. Both are rewritten to accept the same strings
|
|
166
|
+
without the ambiguity, `(?:\s*[:,-])?\s*` and `:[^\S\n]*\n\s+`. The
|
|
167
|
+
five rules' entries in `data/benign-fp-measurement.json` are re-measured
|
|
168
|
+
because their detection fingerprints changed; their false-positive counts
|
|
169
|
+
are unchanged.
|
|
170
|
+
|
|
171
|
+
- **The RAMPART evaluator compiles patterns as SPEC §6.4 says.**
|
|
172
|
+
`integrations/rampart/src/atr_rules_evaluator.py` compiled each rule's
|
|
173
|
+
pattern as written with `re.IGNORECASE | re.MULTILINE`, so `^` and `$`
|
|
174
|
+
matched at every line of a field and the letters of a leading flag group
|
|
175
|
+
took effect (`(?s)` let `.` match a newline). It now removes one leading
|
|
176
|
+
`(?imsx)` group and compiles the rest with `re.IGNORECASE` only, as pyATR
|
|
177
|
+
does. On the rules on main this can change a result only on multi-line
|
|
178
|
+
input to a rule whose first regex condition, the only one the evaluator
|
|
179
|
+
reads, contains `^` or `$`; none of those rules' test samples is matched
|
|
180
|
+
differently by that condition. The evaluator is one of the exports issue
|
|
181
|
+
#698 lists.
|
|
182
|
+
|
|
183
|
+
- **The PyRIT digest, the Cisco Skill Scanner pack and the Pipelock bundle
|
|
184
|
+
now follow SPEC §6.4.** PyRIT's `RegexScorer` and the Cisco scanner
|
|
185
|
+
compile patterns with Python `re` and no flags, Pipelock with Go RE2, and
|
|
186
|
+
both honour an inline flag group. The exporters passed each condition's
|
|
187
|
+
leading group through, so the `(?im)`, `(?si)` and `(?is)` of
|
|
188
|
+
ATR-2026-00450, -00859 and -00207 were applied. A condition written
|
|
189
|
+
without `(?i)` was case-sensitive in the Cisco pack, and in the Pipelock
|
|
190
|
+
bundle's injection rules, which Pipelock releases up to v3.7.0 compile as
|
|
191
|
+
written; Pipelock adds `(?i)` to DLP and tool-poison rules itself, and the
|
|
192
|
+
digest already added it. Each pattern is now `(?i)` followed by
|
|
193
|
+
`regexConditionSpec(value).source`, the pattern the engine compiles; the
|
|
194
|
+
Pipelock bundle puts one `(?i)` in front of a rule's joined alternatives.
|
|
195
|
+
Output change on the rules on main: in `data/pyrit-digest.json`, four
|
|
196
|
+
patterns, of which only ATR-2026-00450#2 matches differently. The digest is
|
|
197
|
+
also regenerated at main for the first time since 4.0.0, in a commit of its
|
|
198
|
+
own: 116 new conditions, 5 removed with the deprecated ATR-2026-00233, 121
|
|
199
|
+
patterns edited in their rules and nine new `condition: all` exclusions.
|
|
200
|
+
The exporter no longer emits a `case_sensitive` marker, which no rule sets
|
|
201
|
+
and §6.4 gives no effect. `tests/pyrit-digest.test.ts` checks the
|
|
202
|
+
transform on fixed inputs and that every committed pattern starts with
|
|
203
|
+
exactly one `(?i)`; it does not compare the digest with the rules, so a
|
|
204
|
+
rule edit does not require regenerating it. The Cisco pack changes 1,161
|
|
205
|
+
of 3,471 patterns in 307 signatures, 1,157 of them because they gain
|
|
206
|
+
`(?i)`; `--reproduce-vendored` keeps the vendored pack's verbatim
|
|
207
|
+
patterns, its output is unchanged, and a new test checks that wiring. The
|
|
208
|
+
Pipelock bundle changes every rule's regex: 814 conditions in 191
|
|
209
|
+
injection rules become case-insensitive on Pipelock releases up to v3.7.0,
|
|
210
|
+
and ATR-2026-00450 no longer matches at the start of a second line; the
|
|
211
|
+
compiler version is now 1.0.1. No pattern starts or stops compiling under
|
|
212
|
+
Python `re` or Go RE2. Issue #698; `tests/compile-pipelock.test.ts` is new.
|
|
213
|
+
|
|
214
|
+
- **The rule converters translate regex conditions per SPEC §6.4.**
|
|
215
|
+
`atr convert generic-regex|splunk|elastic`, the package exports
|
|
216
|
+
`ruleToSPL()`, `ruleToElastic()`, `convertRule()` and `convertAllRules()`,
|
|
217
|
+
and the `converters/sage` and `converters/sage-reverse` subpaths each
|
|
218
|
+
followed a condition's leading flag group instead of SPEC §6.4 (issue
|
|
219
|
+
#698):
|
|
220
|
+
- generic-regex copied the group's letters into `flags`, so a condition
|
|
221
|
+
without `(?i)` exported `flags: ""` (case-sensitive) and `(?im)` or
|
|
222
|
+
`(?is)` turned on multiline or dotAll in the consumer. `flags` is now
|
|
223
|
+
always `i`, or `iu` when the pattern needs Unicode mode.
|
|
224
|
+
- Splunk passed the group to PCRE unchanged, with the same two effects.
|
|
225
|
+
Every regex now starts with a single `(?i)`.
|
|
226
|
+
- Elastic put the group into a Lucene `regexp` value, where inline flags do
|
|
227
|
+
not exist. The value is now the condition without its group;
|
|
228
|
+
`case_insensitive: true` is unchanged.
|
|
229
|
+
- Sage exported a rule as case-sensitive unless a group said `(?i)`. Every
|
|
230
|
+
exported rule now sets `case_insensitive: true`; a condition that depends
|
|
231
|
+
on the `u` flag, which Sage cannot set, is skipped with a warning; and the
|
|
232
|
+
"mixes case-sensitive" and "unsupported inline flags" warnings are gone.
|
|
233
|
+
Importing from Sage (`sage-reverse`) now always writes `(?i)` and warns
|
|
234
|
+
(`case_sensitivity_lost`) when the Sage rule was case-sensitive.
|
|
235
|
+
|
|
236
|
+
The dialect lives in the new dependency-free `src/regex-dialect.ts`
|
|
237
|
+
(`regexConditionSpec()`, `needsUnicodeFlag()`, `inlineCaseInsensitive()`),
|
|
238
|
+
so the published `converters/sage` subpath does not load the engine;
|
|
239
|
+
`src/engine.ts` imports and re-exports it, and the rule-quality and
|
|
240
|
+
rule-latency gates now also run when it changes. The generic-regex docs no
|
|
241
|
+
longer show an import path the package does not export.
|
|
242
|
+
|
|
243
|
+
Upgrade note: exports regenerated after this change differ from earlier
|
|
244
|
+
ones. Conditions without a flag group now match case-insensitively, so a
|
|
245
|
+
SIEM or scanner that loads them can see more matches, and conditions whose
|
|
246
|
+
group had `s` or `m` no longer let `.` cross a line break or `^` and `$`
|
|
247
|
+
match inside the field. Generic-regex `flags` can now be `iu`, so a consumer
|
|
248
|
+
that maps the letters to another regex engine must accept `u`. The Sage
|
|
249
|
+
export skips conditions that depend on `u`. `ReverseWarning['kind']` gains
|
|
250
|
+
`case_sensitivity_lost`; TypeScript code that switches over it exhaustively
|
|
251
|
+
must handle it.
|
|
252
|
+
|
|
7
253
|
## [4.2.1] - 2026-10-24
|
|
8
254
|
|
|
9
255
|
A patch release of rule fixes and one new rule, plus two release-tooling
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elastic.d.ts","sourceRoot":"","sources":["../../src/converters/elastic.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAqB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"elastic.d.ts","sourceRoot":"","sources":["../../src/converters/elastic.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAqB,MAAM,aAAa,CAAC;AAG9D,UAAU,YAAY;IACpB,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,KAAK,EAAE;QACL,IAAI,EAAE;YACJ,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;YACjB,oBAAoB,CAAC,EAAE,MAAM,CAAC;SAC/B,CAAC;KACH,CAAC;CACH;AAiFD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAkDzD"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module agent-threat-rules/converters/elastic
|
|
8
8
|
*/
|
|
9
|
+
import { regexConditionSpec } from '../regex-dialect.js';
|
|
9
10
|
/**
|
|
10
11
|
* Convert a single ATR array condition to an Elastic Query DSL clause.
|
|
11
12
|
*/
|
|
@@ -14,10 +15,15 @@ function conditionToElastic(cond) {
|
|
|
14
15
|
const value = cond.value;
|
|
15
16
|
switch (cond.operator) {
|
|
16
17
|
case 'regex':
|
|
18
|
+
// Lucene regular expressions have no inline flags, so a leading (?i)
|
|
19
|
+
// group was never a flag there: Lucene reads it as literal characters
|
|
20
|
+
// or rejects the query (not tested against a live cluster). Case-insensitivity
|
|
21
|
+
// comes from case_insensitive below (SPEC §6.4: always), and m, s and x
|
|
22
|
+
// have no effect in ATR.
|
|
17
23
|
return {
|
|
18
24
|
regexp: {
|
|
19
25
|
[field]: {
|
|
20
|
-
value: value,
|
|
26
|
+
value: regexConditionSpec(value).source,
|
|
21
27
|
flags: 'ALL',
|
|
22
28
|
case_insensitive: true,
|
|
23
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elastic.js","sourceRoot":"","sources":["../../src/converters/elastic.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"elastic.js","sourceRoot":"","sources":["../../src/converters/elastic.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,EAAE;oBACJ,MAAM,EAAE,EAAE;oBACV,oBAAoB,EAAE,CAAC;iBACxB;aACF;SACF,CAAC;IACJ,CAAC;IAED,MAAM,eAAe,GAAG,UAAiC,CAAC;IAC1D,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAExD,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACpB,OAAO;YACL,KAAK,EAAE,IAAI;YACX,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,IAAI,EAAE,OAAO;iBACd;aACF;SACF,CAAC;IACJ,CAAC;IAED,2BAA2B;IAC3B,OAAO;QACL,KAAK,EAAE,IAAI;QACX,KAAK,EAAE;YACL,IAAI,EAAE;gBACJ,MAAM,EAAE,OAAO;gBACf,oBAAoB,EAAE,CAAC;aACxB;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
* Designed for consumption by any security tool that supports regex matching.
|
|
6
6
|
* Format: JSON array of { id, title, severity, category, patterns[] }
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Each pattern is `{ field, regex, flags, description }` for a consumer that
|
|
9
|
+
* compiles `new RegExp(regex, flags)`. Per SPEC §6.4, `regex` is the condition
|
|
10
|
+
* without its leading flag group and `flags` is always `i`, or `iu` when the
|
|
11
|
+
* pattern needs Unicode mode: every condition matches case-insensitively, and
|
|
12
|
+
* `m`, `s` and `x` have no effect.
|
|
9
13
|
*
|
|
10
14
|
* @module agent-threat-rules/converters/generic-regex
|
|
11
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-regex.d.ts","sourceRoot":"","sources":["../../src/converters/generic-regex.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generic-regex.d.ts","sourceRoot":"","sources":["../../src/converters/generic-regex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGvE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,aAAa,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,gBAAgB,CAkClE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,gBAAgB,EAAE,CAK1F"}
|
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
* Designed for consumption by any security tool that supports regex matching.
|
|
6
6
|
* Format: JSON array of { id, title, severity, category, patterns[] }
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Each pattern is `{ field, regex, flags, description }` for a consumer that
|
|
9
|
+
* compiles `new RegExp(regex, flags)`. Per SPEC §6.4, `regex` is the condition
|
|
10
|
+
* without its leading flag group and `flags` is always `i`, or `iu` when the
|
|
11
|
+
* pattern needs Unicode mode: every condition matches case-insensitively, and
|
|
12
|
+
* `m`, `s` and `x` have no effect.
|
|
9
13
|
*
|
|
10
14
|
* @module agent-threat-rules/converters/generic-regex
|
|
11
15
|
*/
|
|
16
|
+
import { regexConditionSpec } from '../regex-dialect.js';
|
|
12
17
|
/**
|
|
13
18
|
* Convert a single ATR rule to generic regex format.
|
|
14
19
|
*/
|
|
@@ -20,18 +25,14 @@ export function ruleToGenericRegex(rule) {
|
|
|
20
25
|
: Object.values(rule.detection.conditions);
|
|
21
26
|
for (const condition of conditions) {
|
|
22
27
|
if ('operator' in condition && condition.operator === 'regex' && 'value' in condition && condition.value) {
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
if (flagMatch) {
|
|
28
|
-
flags = flagMatch[1];
|
|
29
|
-
regex = regex.slice(flagMatch[0].length);
|
|
30
|
-
}
|
|
28
|
+
// SPEC §6.4. This used to copy the group's letters into `flags`, so a
|
|
29
|
+
// condition without (?i) exported flags "" (case-sensitive) and (?im) or
|
|
30
|
+
// (?is) turned on multiline or dotAll in the consumer.
|
|
31
|
+
const spec = regexConditionSpec(condition.value);
|
|
31
32
|
patterns.push({
|
|
32
33
|
field: 'field' in condition ? condition.field : 'content',
|
|
33
|
-
regex,
|
|
34
|
-
flags,
|
|
34
|
+
regex: spec.source,
|
|
35
|
+
flags: spec.flags,
|
|
35
36
|
description: ('description' in condition ? condition.description : '') ?? '',
|
|
36
37
|
});
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-regex.js","sourceRoot":"","sources":["../../src/converters/generic-regex.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generic-regex.js","sourceRoot":"","sources":["../../src/converters/generic-regex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAoBzD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,MAAM,QAAQ,GAA0B,EAAE,CAAC;IAE3C,k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;KAClC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAyB;IAC3D,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,YAAY,CAAC;SACxC,GAAG,CAAC,kBAAkB,CAAC;SACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -31,7 +31,7 @@ export interface ReverseConvertResult {
|
|
|
31
31
|
}
|
|
32
32
|
export interface ReverseWarning {
|
|
33
33
|
readonly sageId: string;
|
|
34
|
-
readonly kind: 'missing_description' | 'missing_test_cases' | 'missing_compliance' | 'missing_references' | 'category_unknown' | 'match_on_ambiguous';
|
|
34
|
+
readonly kind: 'missing_description' | 'missing_test_cases' | 'missing_compliance' | 'missing_references' | 'category_unknown' | 'match_on_ambiguous' | 'case_sensitivity_lost';
|
|
35
35
|
readonly detail: string;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sage-reverse.d.ts","sourceRoot":"","sources":["../../src/converters/sage-reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EACX,OAAO,EAKP,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAyC,MAAM,WAAW,CAAC;AAEjF,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EACV,qBAAqB,GACrB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"sage-reverse.d.ts","sourceRoot":"","sources":["../../src/converters/sage-reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EACX,OAAO,EAKP,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAyC,MAAM,WAAW,CAAC;AAEjF,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EACV,qBAAqB,GACrB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,oBAAoB,GACpB,uBAAuB,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAwFD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,oBAAoB,CA0G9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,SAAS,EAAE,SAAS,QAAQ,EAAE,GAC5B;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,CAStF"}
|
|
@@ -132,14 +132,19 @@ export function sageToAtr(sage) {
|
|
|
132
132
|
detail: `Multi-channel match_on=${matchOnList.join(',')} expanded to ${matchOnList.length} ATR conditions`,
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
// Build conditions.
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
// Build conditions. An ATR engine matches every regex condition
|
|
136
|
+
// case-insensitively, whatever the pattern says (SPEC §6.4), so the
|
|
137
|
+
// condition always gets (?i) and reads the way it behaves. A case-sensitive
|
|
138
|
+
// Sage rule cannot keep that distinction in ATR; say so instead of
|
|
139
|
+
// importing a pattern that only looks case-sensitive.
|
|
140
|
+
const regexValue = sage.pattern.startsWith('(?i)') ? sage.pattern : `(?i)${sage.pattern}`;
|
|
141
|
+
if (!sage.case_insensitive) {
|
|
142
|
+
warnings.push({
|
|
143
|
+
sageId: sage.id,
|
|
144
|
+
kind: 'case_sensitivity_lost',
|
|
145
|
+
detail: 'Sage rule is case-sensitive; ATR matches every regex condition case-insensitively (SPEC §6.4), so the imported rule can match more inputs',
|
|
146
|
+
});
|
|
147
|
+
}
|
|
143
148
|
const conditions = matchOnList.map((m) => ({
|
|
144
149
|
field: reverseMatchOn(m),
|
|
145
150
|
operator: 'regex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sage-reverse.js","sourceRoot":"","sources":["../../src/converters/sage-reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"sage-reverse.js","sourceRoot":"","sources":["../../src/converters/sage-reverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA6BH,8EAA8E;AAE9E;;;GAGG;AACH,MAAM,oBAAoB,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjF,gBAAgB,EAAE,kBAAkB;IACpC,aAAa,EAAE,gBAAgB;IAC/B,oBAAoB,EAAE,sBAAsB;IAC5C,kBAAkB,EAAE,oBAAoB;IACxC,oBAAoB,EAAE,sBAAsB;IAC5C,kBAAkB,EAAE,oBAAoB;IACxC,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,gBAAgB,EAAE,kBAAkB;CACpC,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAgD,MAAM,CAAC,MAAM,C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,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -16,17 +16,18 @@
|
|
|
16
16
|
* corpus.
|
|
17
17
|
* - ATR `response.actions` (10 values) collapse to Sage `action` (3
|
|
18
18
|
* values: block / require_approval / log) by strongest-wins semantics.
|
|
19
|
-
* -
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* - SPEC §6.4: every ATR regex condition matches case-insensitively, so the
|
|
20
|
+
* leading flag group is removed and every Sage rule sets
|
|
21
|
+
* `case_insensitive: true`. The Sage runtime compiles patterns as JavaScript
|
|
22
|
+
* `RegExp` with only the `i` flag, so a condition that depends on the `u`
|
|
23
|
+
* flag is skipped (sagePatternOf).
|
|
22
24
|
* - ATR `detection_tier: semantic` rules are SKIPPED — they require LLM
|
|
23
25
|
* evaluation, not deterministic regex.
|
|
24
26
|
* - License: ATR rules are MIT; Sage's `threats/*.yaml` are DRL 1.1. Per-rule
|
|
25
27
|
* comment in the output preserves upstream attribution per both licenses.
|
|
26
28
|
*
|
|
27
|
-
* Used by
|
|
28
|
-
*
|
|
29
|
-
* by any downstream tool that consumes ATR but wants Sage-flavoured output.
|
|
29
|
+
* Used by scripts/export-sage.ts, and by any downstream tool that consumes
|
|
30
|
+
* ATR but wants Sage-flavoured output.
|
|
30
31
|
*
|
|
31
32
|
* @module agent-threat-rules/converters/sage
|
|
32
33
|
*/
|
|
@@ -90,8 +91,7 @@ export declare class SageIdAllocator {
|
|
|
90
91
|
* (user_input or tool_response or content), producing 1 Sage rule each.
|
|
91
92
|
*
|
|
92
93
|
* Lossy spots (documented in the bridge research memo):
|
|
93
|
-
* -
|
|
94
|
-
* case-insensitive
|
|
94
|
+
* - Conditions that depend on the `u` flag → skipped (sagePatternOf)
|
|
95
95
|
* - `condition: all` semantics → ignored; alternation always treats as OR
|
|
96
96
|
* - `response.actions` reduced to strongest single action
|
|
97
97
|
* - All compliance/metadata fields (eu_ai_act, mitre_atlas, references, etc.)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sage.d.ts","sourceRoot":"","sources":["../../src/converters/sage.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sage.d.ts","sourceRoot":"","sources":["../../src/converters/sage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EACX,OAAO,EAIP,MAAM,aAAa,CAAC;AAIrB,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,kBAAkB,GAAG,KAAK,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEjF,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,WAAW,EAAE,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,yFAAyF;IACzF,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