Stored Xss Filter Bypass In The Skills Section
A user profile skills field allowed stored HTML that was only partly filtered, so a crafted hyperlink with encoded characters survived and executed JavaScript when the public profile was viewed. An attacker could run script in a victim's browser and read their cookies.
Published on infosecwriteups.com
Inspired by my recent post on LinkedIn, I’m excited to share my first-ever write-up on Medium. In this article, I’ll take you through my experience of finding a stored Cross-Site Scripting (XSS) vulnerability by getting around filters.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the input filter blocked plain script tags and some keywords but did not normalise HTML character references before checking, so an encoded javascript: link passed through.
What the attacker needed
A free account; victim views the public profile
How it was found
- Sign up and log in, then open Settings and Profile Summary.
- Enter a simple script payload in the skills field and view the public profile to see it stripped.
- Try an image error payload, hit the 30-character limit, and extend it to 300 in the HTML.
- Try encoded payloads and a plain javascript: hyperlink, which caused a 404.
- Use a hyperlink with tab entities, then replace them with encoded characters so the link survives.
- View the public profile and the script runs, showing the cookie.
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 write-up has not been written yet. The Original tab links to the source.
A stored cross-site scripting (XSS) bug lets an attacker save code into a website so it runs later in other people's browsers. Here the skills field tried to remove dangerous code but missed a link whose characters were written in an encoded form, so the browser still treated it as JavaScript. When someone opened the public profile, that script ran and could read their cookies, which are small pieces of login data.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.