Skip to content

Commit b7594e6

Browse files
authored
Create README.md
1 parent b8f4379 commit b7594e6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

XML Parser Scripts/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Question of Trust
2+
3+
The xml.etree.ElementTree module provides an easy-to-use library to parse XML data that you trust, such as the XML ouput generated from NMAP. However, when dealing with data you do not trust, there are better avenues.
4+
5+
The below information comes from https://docs.python.org/3/library/xml.html#xml-vulnerabilities as of 11/19/2021.
6+
7+
## Vulnerabilities For ElementTre
8+
9+
| Attack | Vulnerable |
10+
| :---------|------------|
11+
| billion laughs | **Yes** |
12+
| quadratic blowup | **Yes** |
13+
| external entity expansion | No |
14+
| DTD retrieval | No |
15+
| decompression bomb | No |
16+
17+
## Attack Descriptions
18+
19+
The Billion Laughs attack – also known as exponential entity expansion – uses multiple levels of nested entities. Each entity refers to another entity several times, and the final entity definition contains a small string. The exponential expansion results in several gigabytes of text and consumes lots of memory and CPU time.
20+
21+
The quadratic blowup attack is similar to a Billion Laughs attack; it abuses entity expansion, too. Instead of nested entities it repeats one large entity with a couple of thousand chars over and over again. The attack isn’t as efficient as the exponential case but it avoids triggering parser countermeasures that forbid deeply-nested entities.
22+
23+
## Alternative Package
24+
25+
The defusedxml library is a pure Python package with modified subclasses of all stdlib XML parsers that prevent any potentially malicious operation. Use of this package is recommended for any server code that parses untrusted XML data. The package also ships with example exploits and extended documentation on more XML exploits such as XPath injection.
26+
27+
## References
28+
* https://docs.python.org/3/library/xml.html#xml-vulnerabilities
29+
* https://pypi.org/project/defusedxml/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy