Skip to content
Access control Disclosed report Beginner

Upload of Avatars for other Users

An unprivileged authenticated user could change another user's avatar by calling the ufsImportURL API method with a different userId. This allowed attackers to upload avatar pictures on behalf of any other user.

gronke Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 10 days
  • Fixed in 5 months
  • Disclosed after 5.5 years

Unprivileged users were found being able to upload Avatar pictures under the behalf of other users.

Attackers authenticated to the API trigger the ufsImportURL method with a different userId than their own, so that the other users avatar is changed.

The effect of an exploit depends on the storage backend, but the default one coming with a development release, GridFS, is affected.

Releases Affected:

Steps To Reproduce (from initial installation to vulnerability):

(Add details for how we can reproduce the issue)

  1. Authenticate to the API
  2. Invoke ufsImportURL method pointing to other user
  3. Clear browser caches and reload page

Supporting Material/References:

Payload

JSON
["{\"msg\":\"method\",\"method\":\"ufsImportURL\",\"params\":[\"https://radicallyopensecurity.com/images/ros-logo.gif\",{\"name\": \"ros.jpg\", \"extension\": \"jpg\", \"type\": \"text/plain\", \"userId\": \"<USER_ID>\"},\"Avatars\"],\"id\":\"15\"}"]

Suggested mitigation

  • Properly authenticate Avatar uploads

Impact

Any authenticated user can upload avatar pictures for any other user.

The original report as published on HackerOne, by gronke. 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

The ufsImportURL method did not verify that the userId parameter matched the authenticated caller, allowing avatar uploads for arbitrary users.

Impact

Any authenticated user could upload avatar pictures for any other user; the effect depends on the storage backend, with the default GridFS backend affected.

What the attacker needed

An authenticated API session

The fix

Avatar uploads should be properly authenticated so that a user can only change their own avatar.

How it was found

  1. Authenticate to the API
  2. Invoke the ufsImportURL method pointing to another user
  3. Clear browser caches and reload the page

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.

The application lets users set their profile picture by giving it a web address to fetch. The server did not check that the user ID in that request belonged to the person making it, so anyone logged in could change someone else's picture. This is a missing permission check.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by gronke

View all

27 more disclosed reports, best first.

More from Rocket.Chat

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.