• Services
    • Vulnerability Management
    • Pentest
    • Network Pentest
    • Website Security Check
    • Phishing Campaign
    • Mystery Guest
    • Quick scan
  • NetCaptain
  • Knowledge base
  • Partners
    • MSP
  • About us
    • Contact
    • Why CyberAnt
    • News
    • Vacancies
  • Login
  • EN
    • NL
  • Menu Menu

XXE: Entity injection attacks

With entity injection attacks, applications can be attacked and cause data breaches. This happens when the XML parser is configured incorrectly. The most dangerous variant is XXE, which stands for XML eXternal Entity injection. This may involve retrieving external resources, such as arbitrary files from the server or from other locations within the network.

What is XML

XML (eXtendable Markup Language) is a language used to store data in a structured way. The format of this is pre-arranged, and is therefore understandable to both man and machine. XML is used in various ways, such as telling a browser how this page is constructed. An example XML file looks as follows:

John Doe
1
Groningen University

The school system may provide an option to upload new students using an XML file. Its users can save the above example as a students.xml file. After uploading, the school system can read the XML file and query it as a database. This makes XML very suitable for exchanging structured data.

What are entities

The XML format also supports variables. Within XML, such a variable is called an “entity.” Suppose all students are from the same school and to avoid typing “Cyber University” 1,000 times, the following can be done:

John Doe
1
&school;

At the top, the entity “school” is now created, and it is used in the document.

External entities

It can be even more convenient: if the text “Cyber University” is delivered in a separate file, so that the XML file does not need to be modified, the name can also be loaded externally. This can be from a web address or a local other file, for example. This is called “external entities,” also known as XXE.

]>

John Doe
1
&school;

In the above example, the contents of the file “school.txt” are read and used. This is obviously convenient, but can also pose a security problem. This is because if the XML file is loaded on a server, then this way files can be read that are on the server. Suppose there is a file called “passwords.config” in the same directory, this way it is possible to retrieve the passwords from the server, or for example configuration files such as the /etc/passwd file. This could cause a huge data breach!

Entity expansions

Another problem that can occur is “entity expansion.” With this, it is not so much possible to steal data as to make the server inaccessible. A well-known example of this is the “billion laughs attack.” This one is below:












]>
&lol9;
What happens here is that an entity is created with the value “lol”. A new value is then created, with 10x the value of the entity. So now the result is “lollollollollollollol lollollollollol”. This process is repeated until the entity lol9 contains the word lol a billion times. Since a letter takes 1 byte in memory, the last entity takes up 3 billion bytes, which is 3GB. This is a huge drain on the server’s resources, since the result not only has to be put into memory but also compiled. Most servers will crash as a result, and should the server survive, the attack is easily scaled up by adding a few more lines.

Prevent

There is no standard way to prevent entity injection and the billion laughs attack. Most XML parsers do have a setting that can disable this capability. Therefore, please refer to the manual.

Entity injection is common in larger software packages and custom software. During a pen test, CyberAnt checks for this.

Share this article
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share by Mail

Search

Search Search

Recent Posts

  • Pin or no pin: the trade-off around certificate pinning in mobile apps
  • TrapDoor supply-chain attack steals passwords from developers
  • Once again malware found in US Code Extensions
  • Large-scale attack on popular npm packages: millions of websites and apps potentially affected
  • Age verification on the Internet: what about privacy?

CyberAnt is ISO Certified

Iso gecertificeerd

Tags

.DS Store anti-virus award broken access control clickjacking Cryptographic Failures cyberaanval CyberAnt Cybercrime cybercriminelen CyberRisk Cyber Security Datalek Entity injection Etisch Hacker Hacker Insecure Design ISO 9001 ISO 27001 IT Infrastructuur beschermen malware Mass Assignment aanval NetCaptain NetCat shell upgraden Netgear ProSAFE switches nominated Open web application Security project Owasp path traversal penetration test pentest Ransomeware aanval Ransomware Responsible Disclosure secure coding Secure webshop Security Audit Security audits Security Misconfiguration Server-side request forgery (SSRF) Social Engineering SQL Injection supply chain attack vulnerability management web applicatie scanning
CyberAnt is ISO gecertificeerd

Services

  • Pentest
  • Network Pentest
  • Website Security Check
  • Phishing Campaign
  • Mystery Guest

Cyberant

  • Why CyberAnt
  • Partners
  • Knowledge base
  • News
  • About us

Contact

Marconiweg 1
3899 BR Zeewolde

info@cyberant.com
+31 (0)85 047 1590

© Copyright - CyberAnt 2024
  • Link to Facebook
  • Link to LinkedIn
  • Link to Mail
Link to: CVE-2016-7941 – XSS in Netgear ProSAFE switches Link to: CVE-2016-7941 – XSS in Netgear ProSAFE switches CVE-2016-7941 – XSS in Netgear ProSAFE switches Link to: What is clickjacking? Link to: What is clickjacking? clickjackingWhat is clickjacking?
Scroll to top Scroll to top Scroll to top

Deze site maakt gebruik van cookies. Door verder te surfen op de site gaat u akkoord met ons gebruik van cookies.

Accepteer instellingenVerberg de mededeling enkelInstellingen

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Privacy statement
Accepteer instellingenVerberg de mededeling enkel