-
Notifications
You must be signed in to change notification settings - Fork 214
XML Injection
Sam Sanoop edited this page Jan 13, 2026
·
2 revisions
The application allows users to import their profile data via XML. The backend parser (xml2js) converts the XML structure into a JavaScript object and uses it to update the user's document in the database.
However, the update logic blindly trusts the fields provided in the XML. This is a Mass Assignment vulnerability. Even though the "role" or "admin" status is not normally editable by users, an attacker can inject these fields into the XML payload.
- Log in to the application.
- Navigate to the Home area.
- Click on the link "Profile XML (Export/Import)".
- In the "Export Profile" section, enter a bio (optional) and click Export XML.
- You will see an XML structure similar to this:
Note: The
<userProfile> <username>your_username</username> <role>user</role> <bio>your_bio</bio> </userProfile>
<role>tag here is for display purposes, but the backend also checks for an<admin>boolean field.
-
Copy the exported XML.
-
Modify it to include the hidden
<admin>field. Set it totrue. -
You can also modify your bio to confirm the change.
Malicious Payload:
<userProfile> <username>your_username</username> <admin>true</admin> <bio>I am now Admin!</bio> </userProfile>
Note: Ensure you replace
your_usernamewith your actual username (e.g.,vulntestor whatever you logged in as).
- Scroll down to the "Import Profile (XML)" section.
- Paste your malicious payload into the text area.
- Click Import XML.
- You should see a success message indicating the profile was updated. The response data might show
"admin": true.
- Go back to the Home area.
- Check the "Your Profile" card in the left sidebar.
- The Role should now display Admin.
- XML External Entity Injection
- Server Side Request Forgery (SSRF)
- Username Enumeration
- NoSQL Injection
- Insecure Direct Object Reference
- Mass Assignment
- Cross Site Scripting (XSS)
- Hidden API Functionality Exposure
- SQL Injection
- Information Disclosure
- Insecure PostMessage Configuration
- Command Injection
- Prototype Pollution
- JSON Hijacking
- XPath Injection
- Cross Origin Resource-Sharing Misonfiguration
- JWT Secret Key Brute Force
- Vertical Access Control
- Horizontal Access Control
- Open Redirect
- Path Traversal
- Unsafe Deserialization
- Sensitive Data Exposure
- Arbitrary File Write
- Introspection Enabled
- GraphQL Access Control Issues
- GraphQL Batching Brute Force
- API Endpoint Brute Forcing
- CRLF Injection
- XML Injection
- XML Bomb Denial‐of‐Service
- SOAP Injection
- JSON CSRF
- LDAP Injection
- Rate Limit Bypass
- Client Side Template Injection