Skip to content
SSRF Write-up Intermediate

SSRF and Account Takeover via XSS in ERPNext (0-day)

The report describes two vulnerabilities in ERPNext: an SSRF where the Google Sheets import URL validation only checks for a substring, allowing requests to internal services and cloud metadata; and an XSS via uploading an HTML file as a profile image with an upper-case extension, which bypasses Content-Disposition and can lead to account takeover because the password change endpoint does not require the old password.

aszx87410 Follow

Published on tech-blog.cymetrics.io

ERPNext is a very popular open-source ERP(Enterprise Resource Planning) software built on Frappe Framework.

huli (@aszx87410), on tech-blog.cymetrics.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the SSRF is caused by validating the Google Sheets URL with a simple substring check instead of parsing and restricting the host, and the XSS is caused by the backend not validating file extensions and the password change endpoint not requiring the old password.

Impact

A low-privileged authenticated attacker could read cloud metadata credentials and potentially escalate to RCE, and could take over other users' accounts including admins via XSS; the report notes no fix was available at the time of writing.

What the attacker needed

Low-privileged authenticated user; victim opens a link

The fix

The report does not state a fix; it suggests mitigations such as restricting import permissions, isolating ERPNext, requiring IMDSv2, and being careful with links, but proper fixes would be to validate URLs by parsing and restricting hosts, enforce file type checks on the backend, and require the…

How it was found

  1. As a low-privileged user, use the data import feature and provide a URL that contains the Google Sheets substring but points to an internal address.
  2. Observe that the server fetches the internal URL and returns its response, confirming SSRF.
  3. Upload an HTML file as a profile image by intercepting the request and changing the extension to .html.
  4. Notice the Content-Disposition header forces download, then bypass it by using an upper-case .HTML extension.
  5. Craft an HTML page that, when opened by a victim, fetches the CSRF token and user ID, then sends a password change request without the old password.
  6. Send the uploaded page's URL to an admin; when the admin opens it, their password is changed and the attacker can take over the account.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This report is about two security holes in a business software called ERPNext. One lets a logged-in user trick the server into fetching internal web addresses, potentially stealing cloud credentials. The other lets a user upload a web page that runs code in another user's browser, and because the software lets you change a password without knowing the old one, that code can take over the victim's account.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by aszx87410

View all

1 more disclosed report, best first.

More from ERPNext

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.