Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/adobe/aem-desktop/security-global-xxe-preventiongit clone --depth 1 https://github.com/adobe/aem-desktopWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/adobe/aem-desktop/security-global-xxe-prevention)<a href="https://agentmods.dev/rules/adobe/aem-desktop/security-global-xxe-prevention"><img src="https://agentmods.dev/badge/rules/adobe/aem-desktop/security-global-xxe-prevention.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00018 | $0.00482 |
| Opus 5 | $0.00009 | $0.00241 |
| Sonnet 5 | $0.00004 | $0.00096 |
| Haiku 4.5 | $0.00002 | $0.00048 |
Grade A, and why
security-global-xxe-prevention scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
94% identical to xxe-prevention — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.
XXE Prevention
These rules apply to all code that parses or processes XML, regardless of language or framework, including AI-generated code.
All violations must include a clear explanation of which rule was triggered and why, to help developers understand and fix the issue effectively.
Generated code must not violate these rules. If a rule is violated, a comment must be added explaining the issue and suggesting a correction.
1. Disable DTDs and External Entities
- Rule: XML parsers must have Document Type Definitions (DTDs) disabled and must not resolve external entities.
- Example (unsafe, Python with lxml):
from lxml import etree etree.fromstring(user_xml) # External entities allowed ➜ XXE - Example (safe, Python using defusedxml):
from defusedxml.ElementTree import fromstring fromstring(user_xml) # External entities blocked
2. Use Secure Parser Features / Libraries
- Rule: Choose parsers with XXE protection by default (e.g.,
defusedxmlin Python,XMLInputFactorywithXMLConstants.FEATURE_SECURE_PROCESSINGin Java). Verify that features to disallow external DTDs and entities are enabled.
3. Restrict Schema and XInclude Processing
- Rule: Do not allow remote or file-based schema, XInclude, or XSLT processing on untrusted XML unless explicitly required and properly sandboxed.
4. Limit Resource Consumption
- Rule: Configure parser limits (file size, entity expansion depth, timeouts) to prevent Billion Laughs and Quadratic Blow-up DoS attacks.
5. Validate and Sanitize Input Before Processing
- Rule: Validate XML against a known schema or allow-list of expected elements. Reject unexpected or malformed content early.
6. Avoid Logging Sensitive XML Content
- Rule: Do not log raw XML that may contain credentials, personal data, or other sensitive information.
7. Keep Parser Libraries Patched
- Rule: Regularly update XML libraries to incorporate security patches that address newly discovered parser flaws.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 43 lines · 18 tokens per session scan A e9711b4f1db3
security-global-xxe-prevention is a cursor rule published in the GitHub repository adobe/aem-desktop (2 stars, last pushed 10d ago), licensed Apache-2.0. It adds 18 tokens to every session and 482 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to xxe-prevention, differing in 3 lines, and is treated as a copy.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.