Skip to content
XSS Disclosed report Intermediate

[render.bitstrips.com] Stored XSS via an incorrect avatar property value

An avatar property value was not sanitised, so an attacker could store an SVG payload in it. When the rendered PNG failed with a 500 error, the response was served as text/html and the script executed.

s_p_q_r Follow

Originally disclosed on HackerOne

Bounty$400 View original
  • Triaged in 6 days
  • Fixed in 2 months
  • Paid in 43 days
  • Disclosed after 5 months

While modifying an avatar, an attacker has the opportunity to submit XSS payloads as its property values. The resulting png file will return a 500 error with the payload in the response body. The response has a text/html content type, which makes the XSS attack possible.

PoC:

  1. Go to https://www.bitmoji.com/account/ and create a new account
  2. Choose the avatar style and save it. The following POST request will be sent:

POST /user/avatar?styles=1,4&app_id=13 HTTP/1.1 Host: api.bitmoji.com

avatar_id=%id%&char_data=%data%

3. Modify the data value: set any pd2 object property value (for example, jaw) to <svg onload=alert(document.domain)>:

{"colours":{},"pd2":{"cranium":"cranium_midstraightmale","forehead":"forehead_standard","hair_back":"hair_back_midstraightmale","hair_front":"hair_front_midstraightmale","hairbottom":"hairbottom_blank","detail_L2_L":"_blank","detail_L2_R":"_blank","jaw":"<svg onload=alert(document.domain)>","beard":"_blank","stachin":"_blank","stachout":"_blank"},"body":{},"style":1}

and submit the request again.

4. Go to your account and click "Edit yor avatar". In your browser web console you will see a https://render.bitstrips.com/render/***/*.png link with a 500 error. Open this link.

The script will be executed.

A PoC link: https://render.bitstrips.com/render/6688424/173752531_2_s1-v1.png

I also recorded a video (see the attachment) of these steps, I hope it will help you reproduce the issue.

Attachments

The original report as published on HackerOne, by s_p_q_r. 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 avatar property values were stored without sanitisation and the render error response was returned with a text/html content type instead of a safe type.

Impact

An attacker could run script in the browser of anyone who opened the crafted render link.

What the attacker needed

A free account; victim opens the crafted render link

How it was found

  1. Create a new account on the Bitmoji account page.
  2. Choose an avatar style and save it, which sends a POST request to the avatar endpoint.
  3. Modify the data value by setting an avatar property to an SVG with an onload handler, then resubmit the request.
  4. Go to the account and click to edit the avatar.
  5. Find the render link that returns a 500 error in the browser console and open it.
  6. The script executes.

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.

A website lets you customise an avatar and saves the details. One of those details was not cleaned, so someone could put a small script in it. When the avatar picture failed to render, the server sent back an error page that ran the script in the victim's browser.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by s_p_q_r

View all

14 more disclosed reports, best first.

More from Snapchat

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.