The Basic Vulnerabilities of the Web--XXE Vulnerabilities

Big Brother article: (14 messages) [web security] - XXE vulnerability quick start_Dayday Security Blog-CSDN Blog

Table of contents

1. XML entities

2. Classification of XML entities

For details, please see the big article

2. XXE Vulnerability Introduction

1. The principle of XXE vulnerability

2. The harm of XEE vulnerability

3. Vulnerability prevention


1. Introduction to xml language

XML is a structural markup language used to mark electronic files , which can be used to mark data and define data types. It is a source language that allows users to define their own markup languages. XML document structure includes XML declaration, DTD document type definition (optional), document element
XMl is designed to transmit and store data. XML documents form a tree structure that starts at the " root " and expands to " leaves " .
XMl allows authors to define their own tags and their own document structure.
XML was designed to transmit and store data.
HTML is designed to display data
 
<?xml version="1.0"?>
<!DOCTYPE note [<!-- Define this document as a document of note type -->
<!ELEMENT note (nuc,edu)><!-- There are four elements defining the note element -->
<!ELEMENT nuc (#PCDATA)><!-- Define the to element as "#PCDATA" type -->
<!ELEMENT edu (#PCDATA)><!-- Define the from element as "#PCDATA" type -->
]>
<note>
<nuc>hello</nuc> // document element
<edu>world</edu>
</note>

1. XML entities

So the entity Entity appeared to solve this problem.  Entity Entity is a simple storage unit that can be assigned to it like an xml variable and referenced to it in different places in the xml document . Entities are defined and described separately in the Document Type Definition Part (DTD) of an XML document.

2. Classification of XML entities

1. Internal entity

2. External entities

Internal entities are equivalent to writing DTD content by yourself, while external entities are equivalent to introducing external DTD content

For details, please see the big article

 (14 messages) XML Tutorial (one article to thoroughly understand XML)_Riding a motorcycle snail's blog-CSDN blog

2. XXE Vulnerability Introduction

 The full name of XXE is XML External Entity Injection, that is, XMl external entity injection vulnerability

1. The principle of XXE vulnerability

 XXE is XML External Entity Injection . When external entities are allowed to be referenced , XML data may be modified by criminals during transmission . If the server executes maliciously inserted code, the purpose of attack can be achieved. Attackers can construct malicious content , It may lead to arbitrary file reading, system command execution, intranet port detection, attacking intranet websites and other hazards.

2. The harm of XEE vulnerability

Read arbitrary files, execute system commands, scan intranet ports, attack intranet websites, launch dos attacks, etc. 

3. Vulnerability prevention

   1. Disable the use of external entities, such as libxml disable_entity_loader(true).

   2. Filter the XML data submitted by users to prevent illegal content from appearing.

Guess you like

Origin blog.csdn.net/weixin_62421736/article/details/131053778