Harsh Bothra Profile picture
Apr 1 14 tweets 2 min read
#SecurityExplained S-91: CWE Top 25:
CWE-611: Improper Restriction of XML External Entity Reference

1/n
2/n

When an application executes an XML document that contains entities pointing to external URIs, CWE-611 vulnerabilities can occur.
3/n

These URIs resolve to assets outside the application's control, resulting in potentially dangerous execution of activities prescribed by the external assets.
4/n

An issue in parsing an XML file containing XML entities with URIs that potentially refer to documents beyond the intended place is the source of the flaw.
5/n

If the program fails to check the path to documents before including them, the attacker can consist of any file from a local or remote system and have it displayed by the application.
6/n

XML uses a tree-like structure of tags and data to store and convey data. A document type definition (DTD) can be found in an XML document, and its declarations describe the document's structure, data values, rights, and so on.
7/n

The DTD might be embedded in the document or referenced from another location. You can specify "XML entities" in DTDs, which refer to values in the document in the same way that variables are used in programming languages.
8/n

The XXE attack is based on the ability of the XML language to declare arbitrary entities using an external Data Type Definition (DTD) and the ability to read and execute files.
9/n

# Potential Impact:
The impact can range from local / remote file inclusion to remote command execution and entire system compromise, depending on the application's implementation and architecture.
10/n

This vulnerability can also be exploited to execute internal network port scans on the affected machine or servers.

The attacker may be able to access arbitrary files on the system if a malicious DTD is included and a default entity resolver is enabled.
11/n

The DTD can include any HTTP request that the server can handle. Therefore, other attacks could be launched due to the server's trust connection with other entities.
12/n

# Mitigations:

This vulnerability is frequently introduced to the program during the architecture and design phase. Therefore, it is nearly impossible to mitigate this vulnerability without modifying the application source code in most circumstances.
13/n

External entity expansion can be disabled in many XML parsers and validators.

Allowing application functionality that parses XML documents should be avoided.
n/n

Implement server-side input validation, filtering, or sanitization that is positive allowlisting to prohibit malicious data from entering XML documents or headers.

Configure the XML parser so that no DTD declarations are validated or processed.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Harsh Bothra

Harsh Bothra Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @harshbothra_

Apr 1
14 Payload Repositories to find all the required Payloads & Attack Vectors.

🧵
1/

1. Payloads All The Things

github.com/swisskyrepo/Pa…
2/

2. Payload Box
github.com/payloadbox/
Read 16 tweets
Mar 31
#SecurityExplained S-90: CWE Top 25: CWE-918: Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream component and obtains its contents, but it does not check that the request is routed to the correct destination.

1/n
2/n

Malicious parties can use CWE-918, also known as server-side request forgeries (SSRF), to trick a server into making requests to obtain access to internal infrastructure, sensitive data, and more.
3/n

The use of URLs helps identify the attack surface for SSRF. Although sanitization and allow lists are two more effective techniques available, they can be challenging to manage.
Read 14 tweets
Mar 30
11 MindMaps I have created that you may find useful!

🧵
1/

1. XML Attacks

xmind.net/m/xNEY9b/
2/

2. Account Takeover Techniques

xmind.net/m/M3WEqG/
Read 14 tweets
Mar 30
#SecurityExplained S-89: CWE Top 25: CWE-522: Insufficiently Protected Credentials

The product transfers or saves authentication credentials, but it does so improperly that it can be intercepted or retrieved by unauthorized individuals.

1/n
2/n

This flaw relates to an architectural security approach that has been misdesigned. Another form of credential attack uses flaws in how passwords are encoded, saved, and handled by a web application, network, or software system.
3/n

Risky development practices, such as storing passwords in insecure locations, storing credentials in plaintext, storing user passwords using poor or reproducible cryptographic techniques, or using hard-coded credentials, generate vulnerabilities....
Read 8 tweets
Mar 29
#SecurityExplained S-88: CWE Top 25: CWE-732: Incorrect Permission Assignment for Critical Resource

The product defines permissions for a security-critical resource so that unwanted actors can read or modify it.

1/n
2/n
When a resource's permissions are set to allow access to a broader range of actors than is required, sensitive information may be exposed, or undesired parties may modify the resource.
3/n

This is very risky when the resource is tied to program configuration, execution, or sensitive user data.
Read 15 tweets
Mar 28
9 Free Practice Labs to Master Cross-Site Scripting
1/

1. PortSwigger XSS Labs
portswigger.net/web-security/c…
2/

2. Google XSS Game

xss-game.appspot.com
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(