Server Side Request Forgery in Uppy npm module
The Uppy companion module's /get endpoint passed a user-supplied URL directly to a download function without validation, allowing server-side request forgery. An attacker could use this to read internal resources such as cloud metadata or interact with internal services.
Originally disclosed on HackerOne
- Triaged in 11 days
- Fixed in 28 days
- Disclosed after 31 days
Hi Team,
While we were testing our security engine at Shieldfy (https://shieldfy.io), We found a server side request forgery (SSRF) vulnerability in Uppy npm package. It allows hacker to easily extract inside information from the server or take control of internal services.
Module
module name: Uppy
version: Latest: 1.8.0
npm page: https://www.npmjs.com/package/uppy
Module Description
Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly with any application. It’s fast, easy to use and lets you worry about more important problems than building a file uploader.
Module Stats
[1] weekly downloads : 23,153
Vulnerability
Server Side Request Forgery ( SSRF )
Vulnerability Description
in the source code of the module file: packages/@uppy/companion/src/server/controllers/url.js line: 11
You will find the express is routing the /get endpoint to the function get declared in line 43
Then it calls [downloadURL in line61](https://github.com/transloadit/uppy/blob/746bbcbbc5dc64203390322b28fb380ec67bd94f/packages/%40uppy/companion/src/server/controllers/url.js#L61) and pass req.body.url` to it as argument
in the function downloadURL declared in line 80
It calls the url directly without any kind of sanitization or validation, opens the door to send malicious ssrf attack, allowing the hacker to extract information from any internal resource, or take control of any internal service.
Steps To Reproduce:
- deploy the module in live server (ex: digital ocean server)
- request 'Add More button' then click on
Link button - Submit Link of DigitalOcean metadata api
http://169.254.169.254/metadata/v1/ - once done uploading , download the file you should see the content of the server metadata
id
hostname
user-data
vendor-data
public-keys
region
interfaces/
dns/
floating_ip/
tags/
features/
Patch
The suggested fix.
- use whitelist technique in the url protocol ( allow only http & https ), and on the port ( 80 & 443 )
- use blacklist technique in the host (disable IPs v4 & v6 allowing only domains, disable domains that used as internal routing if any)
- disable redirection
followAllRedirectsto avoid bypasses
Supporting Material/References:
More info about ssrf can be found here : https://shieldfy.io/security-wiki/server-side-request-forgery/server-side-request-forgery/
Wrap up
- I contacted the maintainer to let them know: N
- I opened an issue in the related repository: N
Impact
- Scan local or external network
- Read files from affected server
- Interact with internal systems
- Remote code execution
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application accepted a user-controlled URL and fetched it without validating the protocol, host, or redirects.
Impact
An attacker could scan local or external networks, read files from the affected server, and interact with internal systems.
What the attacker needed
Uppy companion deployed on a server; attacker can submit a URL
The fix
The module should be fixed by whitelisting protocols and ports, blocking internal IP addresses and hostnames, and disabling automatic redirects.
How it was found
- Deploy the Uppy companion module on a live server.
- Open the upload interface and choose the link option.
- Submit a link pointing to the cloud metadata service.
- After the upload completes, download the file to view the metadata contents.
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 report has not been written yet. The Original tab links to the source.
Server-side request forgery (SSRF) is when a server is tricked into making a request to a location the attacker chooses, such as an internal system that is not reachable from the internet. Here, the file-uploader's backend fetched any web address a user provided, so an attacker could ask it to fetch sensitive internal pages and then download the result.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.