hunting-xpath-and-xml-query-injection

hunting-xpath-and-xml-query-injection is a skill for Claude Code from UnboundCompute/security-agent-skills. It costs 160 tokens per session (1,999 once invoked), scanned A, original, MIT.

A security-audit guide for finding XPath and XQuery injection in applications that query XML. XPath and XQuery are query languages for selecting data from XML, and injection occurs when input changes the query itself instead of being treated as a value.

In plain words
What is it for?
Use it to review login, authorization, and lookup code that evaluates XPath or XQuery against XML documents or XML databases. Check whether request values are safely bound as parameters rather than pasted into expressions.
Why use it?
It helps prevent attackers from bypassing checks or reading more XML data than intended. The main issue is building query text by joining it with request data.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the security-agent-skills plugin — 194 skills shipped together

Good fit Use it to review login, authorization, and lookup code that evaluates XPath or XQuery against XML documents or XML databases. Check whether request values are safely bound as parameters rather than pasted into expressions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/unboundcompute/security-agent-skills/hunting-xpath-and-xml-query-injection
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.

Any agent
npx skills add UnboundCompute/security-agent-skills --skill hunting-xpath-and-xml-query-injection
Clone the repo
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills

Made for: Claude Code.

Or install security-agent-skills, the plugin that ships this one along with the rest of its 194 skills.

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 hunting-xpath-and-xml-query-injection

README.md
[![agentmods](https://agentmods.dev/badge/skills/unboundcompute/security-agent-skills/hunting-xpath-and-xml-query-injection/github.svg)](https://agentmods.dev/skills/unboundcompute/security-agent-skills/hunting-xpath-and-xml-query-injection)
Your own site
<a href="https://agentmods.dev/skills/unboundcompute/security-agent-skills/hunting-xpath-and-xml-query-injection"><img src="https://agentmods.dev/badge/skills/unboundcompute/security-agent-skills/hunting-xpath-and-xml-query-injection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hunting-xpath-and-xml-query-injection

Your own site · 80×15
<a href="https://agentmods.dev/skills/unboundcompute/security-agent-skills/hunting-xpath-and-xml-query-injection"><img src="https://agentmods.dev/badge/skills/unboundcompute/security-agent-skills/hunting-xpath-and-xml-query-injection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,999 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.1 $0.00160 $0.01999
Opus 5.5 $0.00064 $0.00800
Sonnet 5.5 $0.00032 $0.00400
Haiku 4.5 $0.00016 $0.00200

Measured 1mo ago against content hash d9630c251084, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

hunting-xpath-and-xml-query-injection 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 1mo 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.

skills/hunting-xpath-and-xml-query-injection/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Hunting XPath and XQuery injection: when input rewrites the query

XPath and XQuery are to XML what SQL is to a relational database, and they carry the same injection flaw. When an application builds a query by pasting untrusted input into the expression string, an attacker who supplies query syntax instead of a plain value changes what the query means. A login check that looks up a user node by matching a name and password predicate can be turned into a predicate that is always true, logging in as the first user with no credential. A lookup scoped to one node can be widened to walk the entire document and return records the caller should never see. Because XML documents have no table grants, the whole document is usually reachable once the expression is under attacker control. You find these by locating every expression built from request data and asking whether the input is bound as a parameter or concatenated as syntax.

When to use

  • Code builds an XPath or XQuery expression by concatenating or interpolating request-derived strings.
  • Authentication, authorization, or lookup logic evaluates such an expression against an XML document.
  • An XML database or an XML-backed configuration store is queried with input-derived expressions.

Scope check

Test XPath and XQuery injection only against applications you own or are authorized to assess, with test accounts and test data, because a confirming query can read other users' records out of the document. Prefer boolean and structural probes over bulk extraction, and coordinate before dumping data. If you can't name the authorization, stop.

The loop

  1. Establish that the expression is concatenated, not parameterized, first. Locate every XPath or XQuery evaluation and read how its expression string is assembled. This is the false-positive killer: if the expression is a fixed literal and untrusted input is bound through a variable resolver or a precompiled expression with typed parameters, the input can only be a value and the query structure is fixed, so there is no injection. Name the evaluations where input is pasted into the string.

Read the full file on GitHub · 137 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. 1mo ago First seen · 137 lines · 160 tokens per session scan A d9630c251084

Subscribe to this mod's changes

hunting-xpath-and-xml-query-injection is a skill published in the GitHub repository UnboundCompute/security-agent-skills (5 stars, last pushed 1mo ago), licensed MIT. It adds 160 tokens to every session and 1,999 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

prodcheck-review

Review this codebase against the prodcheck pre-production checklists — security, performance, scale, integrations, post-launch readiness and people. Use when asked to check whether a project is ready to ship, to audit an area before launch, or to work through a specific checklist. Produces evidence with file:line…

FarzamHabibi/pre-production-checklist · 72 tokens

integrate-arcjet-guard-genkit

Integrate Arcjet security into a Genkit JS agent using @arcjet/guard — wrap ai.defineTool, put guardMiddleware on generate({ use }) for unwrapped / MCP / filesystem tools, and read a caller-owned id from generate({ context }). Use when asked to add Arcjet to genkit, rate limit its tools, screen inbound messages, or…

arcjet/arcjet-js · 89 tokens

integrate-arcjet-guard-tanstack-ai

Integrate Arcjet security into a TanStack AI chat() app using @arcjet/guard — put guardMiddleware first on chat({ middleware }) so onBeforeToolCall gates tools, and read a caller-owned id from chat({ context }). Use when asked to add Arcjet to TanStack AI, rate limit its tools, screen inbound messages, or block prompt…

arcjet/arcjet-js · 103 tokens

integrate-arcjet-guard-claude-managed-agents

Integrate Arcjet security into Claude Managed Agents (hosted REST+SSE, beta managed-agents-2026-04-01) using @arcjet/guard — screen user.message / initialevents before sessions.events.send, and gate custom tools on agent.customtooluse. Use when asked to add Arcjet to Claude Managed Agents, rate limit custom tools, or…

arcjet/arcjet-js · 102 tokens

linear-claude-skill

Manage Linear issues, projects, and teams.

Agent-Threat-Rule/agent-threat-rules · 15 tokens

varlock-claude-skill

Secure environment variable management ensuring secrets are never exposed in Claude sessions, terminals, logs, or git commits.

Agent-Threat-Rule/agent-threat-rules · 28 tokens