Blog

보안 코딩 기법: XML 데이터 처리, 1부작

December 10, 2017
Pieter De Cremer

확장 마크업 언어 (XML) 는 컴퓨터에서 다루기 쉽고 사람이 읽을 수 있는 형식으로 문서를 인코딩하는 데 사용되는 마크업 언어입니다.그러나 일반적으로 사용되는 이 형식에는 여러 가지 보안 결함이 있습니다.이 첫 번째 XML 관련 블로그 게시물에서는 스키마를 사용하여 XML 문서를 안전하게 처리하는 기본 사항을 설명하겠습니다.

OWASP는 XML 및 XML 스키마와 관련된 여러 취약점을 두 범주로 나눕니다.

형식이 잘못된 XML 문서

형식이 잘못된 XML 문서는 W3C XML 사양을 따르지 않는 문서입니다.문서의 형식이 잘못되는 몇 가지 예로는 끝 태그를 제거하거나 다른 요소의 순서를 변경하거나 금지된 문자를 사용하는 경우가 있습니다.이러한 모든 오류로 인해 치명적인 오류가 발생할 수 있으므로 문서에 추가 처리를 거치지 않아야 합니다.

잘못된 문서로 인한 취약점을 피하려면 W3C 사양을 따르고 잘못된 문서를 처리하는 데 시간이 오래 걸리지 않는 잘 테스트된 XML 파서를 사용해야 합니다.

잘못된 XML 문서

잘못된 XML 문서의 형식은 올바르지만 예상치 못한 값이 포함되어 있습니다.여기서 공격자는 XML 스키마를 제대로 정의하지 않은 응용 프로그램을 이용하여 문서가 유효한지 여부를 식별할 수 있습니다.아래에서 제대로 검증하지 않을 경우 의도하지 않은 결과를 초래할 수 있는 문서의 간단한 예를 확인할 수 있습니다.

트랜잭션을 XML 데이터에 저장하는 웹 스토어:

<purchase></purchase>
<id>123</id>
<price>200</price>

그리고 사용자는 <id>값에 대한 제어만 할 수 있습니다.그러면 적절한 대응 수단이 없어도 공격자는 다음과 같은 내용을 입력할 수</id> 있습니다.

<purchase></purchase>
<id>123</id>
<price>0</price>
<id></id>
<price>200</price>

이 문서를 처리하는 파서가 <id>및 <price>태그의 첫 번째 인스턴스만 읽는 경우 원치 않는 결과가 발생할 수</price></id> 있습니다.

스키마가 충분히 제한적이지 않거나 다른 입력 유효성 검사가 불충분하여 음수, 특수 소수 (예: NaN 또는 Infinity) 또는 너무 큰 값을 예상하지 못한 위치에 입력하여 유사한 의도하지 않은 동작이 발생할 수도 있습니다.

잘못된 XML 문서와 관련된 취약점을 피하려면 정확하고 제한적인 XML 스키마를 정의하여 부적절한 데이터 검증 문제를 방지해야 합니다.

다음 블로그 포스트에서는 점보 페이로드와 OWASP Top Ten 넘버 4인 XXE와 같은 XML 문서에 대한 고급 공격에 대해 알아보겠습니다.

그 동안 XML 입력 검증에 대한 기술을 연마하거나 도전할 수 있습니다. 우리 포털에서.

XML 및 XML 스키마 사양에는 여러 보안 결함이 있습니다.이와 동시에 이러한 사양은 XML 응용 프로그램을 보호하는 데 필요한 도구를 제공합니다.XML 스키마를 사용하여 XML 문서의 보안을 정의하지만 이러한 스키마는 파일 검색, 서버 측 요청 위조, 포트 스캐닝 또는 무차별 대입 등 다양한 공격을 수행하는 데 사용될 수 있습니다.

https://www.owasp.org/index.php/XML_Security_Cheat_Sheet

태그라인

Govern AI-driven development before it ships

Measure AI-assisted risk, enforce secure coding policy at commit, and accelerate secure delivery across your SDLC.

book a demo
태그라인

Explore more blogs

우리는 이 방법을 잘 알고 있습니다. 우리는 이 두 가지 축복을 골고루 살기 위해 노력하고 있습니다.

browse all
Case Study
Filter Label
This is some text inside of a div block.

Supercharged Security Awareness: How Tournaments are Inspiring Developers at Erste Group

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Learn More
Case Study
Filter Label
This is some text inside of a div block.

Security as culture: How Blue Prism cultivates world-class secure developers

Learn how Blue Prism, the global leader in intelligent automation for the enterprise, used Secure Code Warrior's agile learning platform to create a security-first culture with their developers, achieve their business goals, and ship secure code at speed

Learn More
Case Study
Filter Label
This is some text inside of a div block.

One Culture of Security: How Sage built their security champions program with agile secure code learning

Discover how Sage enhanced security with a flexible, relationship-focused approach, creating 200+ security champions and achieving measurable risk reduction.

Learn More
Blog
Filter Label
This is some text inside of a div block.

Enabler 7: Developer Recognition

Recognition fuels participation. Enabler 7 celebrates developer achievement loudly, with rewards and exclusive swag that mark real, earned secure coding wins.

Learn More
Blog
Filter Label
This is some text inside of a div block.

Named in the Gartner® Hype Cycle™ for Application Security 2026

Secure Code Warrior is named in the Gartner® Hype Cycle™ for Application Security, 2026 for Agentic Coding Security and Secure Coding Training. Here's why.

Learn More
Blog
Filter Label
This is some text inside of a div block.

Are you a CISO or Engineering Leader worried about the Security and Cost of LLM code generation?

Review the SCW AI Trust Index, our proprietary LLM benchmarking data, before going all-in on an AI model.

Learn More

Secure AI-driven development before it ships

See developer risk, enforce policy, and prevent vulnerabilities across your software development lifecycle.

데모 예약하기
No items found.