Skip to content
Misconfiguration Disclosed report Intermediate

API - Amazon S3 bucket misconfiguration

The mobile app's upload API returned a pre-signed S3 upload policy and temporary access key for the bucket, and the API itself required no authentication token. An attacker could use the returned credentials to upload arbitrary files of any size to the bucket, turning it into free cloud storage.

c37m Follow

Originally disclosed on HackerOne

  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 4 months

Dear, BCM Messenger ##Description My discovering was starting from com.bcm.messenger, First, i trace what application send and receive from the network so i use Frida tool to bypass SSL pinning, Then i was able to trace application http traffic, and since API data is not encrypted and there's nothing protect API such as token... that's make the API Opened to public .

So in this point : http://47.52.75.65:8080//v1/attachments/s3/upload_certification application send demand to upload image (profile image ) Api respond with :

JSON
{"downloadUrl":"https://d3v5qmgpw891au.cloudfront.net/profile/1CDfyqYQfPRs2m1a1VSMaD89GZ63Mwu78N/7a6998d3f4ab421e9619627b33f1ce6b","fields":[{"key":"key","value":"profile/1CDfyqYQfPRs2m1a1VSMaD89GZ63Mwu78N/7a6998d3f4ab421e9619627b33f1ce6b"},{"key":"X-Amz-Credential","value":"AKIA3NG2JXZC3SY2WNXE/20191225/ap-east-1/s3/aws4_request"},{"key":"X-Amz-Date","value":"20191225T002608Z"},{"key":"X-Amz-Algorithm","value":"AWS4-HMAC-SHA256"},{"key":"Policy","value":"eyAiZXhwaXJhdGlvbiI6ICIyMDE5LTEyLTI1VDAwOjU2OjA4LjAwMFoiLAogICJjb25kaXRpb25zIjogWwogICAgeyJidWNrZXQiOiAiYmNtLWhrIn0sCiAgICBbImVxIiwgIiRrZXkiLCAicHJvZmlsZS8xQ0RmeXFZUWZQUnMybTFhMVZTTWFEODlHWjYzTXd1NzhOLzdhNjk5OGQzZjRhYjQyMWU5NjE5NjI3YjMzZjFjZTZiIl0sCiAgICBbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwgMSwgNjcxMDg4NjRdLAogICAgeyJ4LWFtei1jcmVkZW50aWFsIjogIkFLSUEzTkcySlhaQzNTWTJXTlhFLzIwMTkxMjI1L2FwLWVhc3QtMS9zMy9hd3M0X3JlcXVlc3QifSwKICAgIHsieC1hbXotYWxnb3JpdGhtIjogIkFXUzQtSE1BQy1TSEEyNTYifSwKICAgIHsieC1hbXotZGF0ZSI6ICIyMDE5MTIyNVQwMDI2MDhaIiB9CiAgXQp9"},{"key":"X-Amz-Signature","value":"dc4f9003a5613f72ee7b13154deaa503dcc23eb233d6fb651e12b907926f86ce"}],"postUrl":"https://bcm-hk.s3.ap-east-1.amazonaws.com/"}

So as you can see, the bucket name is bcm-hk with <access-key-id> = AKIA3NG2JXZC3SY2WNXE

By this json data we can upload any file with any size to this bucket for (current user) .

##PoC : I Write a Python3 script ( (Attachment on the original report: aws.py) ) make the upload file fast and easy : USAGE : python aws.py filename

Chose any file with any size , the file will uploaded and encoded with base65 Requirement : requests,json,base64,mimetypes,sys

poc_IC_bcm.png
poc_IC_bcm.png From the original on HackerOne

File saved in : https://bcm-hk.s3.ap-east-1.amazonaws.com/profile%2F14HXhz8Aef9NnH1Ubvwb5gEXUebzZjtEem%2F23a3ca622f9d4e52bc69387451580ae8

Impact

Risk :

Since the registration is free, and no limit of how much account can be opened from one user (no email check , no phone check ...) attacker or ATTACKERS find this bucket as free cloud service they will upload what they want and share they files using your resources (in groups,in their communities ... ) so you will get fake users or hackers.

Best regards , Mohamed Slamat [email protected]

The original report as published on HackerOne, by c37m. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Likely the upload endpoint issued S3 pre-signed policies without authenticating the caller and without restricting file type or size beyond a very large content-length range.

Impact

Because registration is free and unlimited, attackers could use the bucket as free cloud storage and share files through the company's resources, creating fake accounts and consuming bandwidth and storage.

What the attacker needed

Mobile app traffic interception; SSL pinning bypass (Frida)

How it was found

  1. Intercept the app's network traffic, bypassing SSL pinning with Frida.
  2. Observe the request the app makes to the attachments upload endpoint.
  3. Read the JSON response containing the bucket name, access key and signed policy.
  4. Use the returned fields to upload an arbitrary file to the bucket.
  5. Confirm the uploaded file is reachable via the bucket's public URL.

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.

When an app uploads a profile picture, the server usually hands the app a short-lived permission slip to write one file to cloud storage. Here the server gave out that slip without checking who was asking, and the slip allowed any file of any size. Anyone who could reach the API could therefore use the company's storage as their own free file host.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More from BCM Messenger

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.