security-global-xxe-prevention

security-global-xxe-prevention is a cursor rule for Cursor from adobe/aem-desktop. It costs 18 tokens per session (482 once invoked), scanned A, a copy of xxe-prevention, Apache-2.0.

Um conjunto de regras para impedir XXE, um ataque que explora arquivos XML para ler recursos externos ou acessar dados indevidos.

In plain words
What is it for?
Serve para orientar a configuração segura de leitores XML, desativando DTDs, entidades externas e recursos relacionados.
Why use it?
Evita que um XML malicioso faça o sistema buscar arquivos, entidades ou recursos fora do documento esperado.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/adobe/aem-desktop/security-global-xxe-prevention
Clone the repo
git clone --depth 1 https://github.com/adobe/aem-desktop

Made for: Cursor.

Wrote 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.

agentmods badge for security-global-xxe-prevention

README.md
[![agentmods](https://agentmods.dev/badge/rules/adobe/aem-desktop/security-global-xxe-prevention.svg)](https://agentmods.dev/rules/adobe/aem-desktop/security-global-xxe-prevention)
Your own site
<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>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 482 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 94% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 4d ago against content hash e9711b4f1db3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

Origin

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.

.cursor/rules/security-global/security-global-xxe-prevention.mdc · 43 lines

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., defusedxml in Python, XMLInputFactory with XMLConstants.FEATURE_SECURE_PROCESSING in 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.

Read the full file on GitHub · 43 lines

Changes

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.

  1. 4d ago First seen · 43 lines · 18 tokens per session scan A e9711b4f1db3

Subscribe to this mod's changes

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.