Stored XSS via SVG Upload in chat.line.biz
The chat.line.biz application allowed SVG file uploads without filtering embedded scripts. An attacker could upload a malicious SVG containing JavaScript, and when another user opened it in the management interface, the script would execute in their browser, resulting in stored XSS.
- Triaged in 24 hours
- Fixed in 4 months
- Paid in 4 months
- Disclosed after 10 months
Summary by the program
The web application allowed users to upload SVG files via chat.line.biz without properly filtering or disabling scripts embedded inside the SVG content. As a result, an attacker could upload a malicious SVG containing JavaScript, and when another user later opened this file in the management interface, the embedded script would be executed in the browser, leading to a stored cross-site scripting (Stored XSS) vulnerability.
What the report shows
The target is the chat management interface at chat.line.biz, part of LINE Messenger's chat offering. The feature in question is file upload: the application let users upload SVG files, and it did not properly filter or disable scripts embedded inside the SVG content.
According to the summary, the attack path is short:
- An attacker uploads an SVG file that contains JavaScript.
- Another user later opens that file in the management interface.
- The embedded script executes in that user's browser.
Because the payload is stored on the server and runs when a different user views it, the issue is a stored cross-site scripting vulnerability. The report is rated low severity and a bounty of 100.00 USD was paid. The summary does not describe the exact upload endpoint, the request used, the payload, or the fix that was applied.
Root cause
The mistake was that SVG uploads were accepted without properly filtering or disabling scripts embedded inside the SVG content. SVG is an XML format that can carry <script> elements and event handler attributes, so a file that looks like an image can behave like an HTML document when the browser renders it. If the application serves uploaded SVGs in a way that lets embedded script run, that script executes in the browser of the user who opens the file.
Impact
The report's own framing is that the script executes in the browser of another user who opens the uploaded file in the management interface. That gives an attacker script execution in the browser of another user who opens the uploaded file in the management interface. The summary does not state which actions the script could perform, what data it could reach, or whether any additional conditions (such as a particular viewer role) were required, so the practical reach beyond script execution in the victim's browser is not established by the text.
How this kind of bug works
Stored XSS happens when user-supplied content is persisted and later rendered to other users without adequate encoding or isolation. The classic case is a text field echoed into an HTML page. File uploads are a less obvious variant: the danger depends on how the stored file is served.
SVG is the usual culprit because it is both an image format and an XML document. It can contain <script> elements, onload and other event attributes, and references to external resources. When a browser loads an SVG as an image through an <img> tag, scripting is generally not executed. When the same file is opened directly, embedded in the page, or served with an HTML-ish content type, the script can run. The vulnerability therefore hinges on the delivery path: content type, Content-Disposition, and whether the file is rendered inline in the application's own origin.
Defences work at several layers: rejecting or sanitising active content in uploaded SVGs, serving user files from a separate origin or sandboxed domain, forcing download with Content-Disposition: attachment, and applying a restrictive Content Security Policy.
How to test for it
- Find upload features that accept images, documents, avatars or attachments, and check whether SVG is among the accepted types. Try changing the file extension and the declared content type if SVG is rejected outright.
- Upload a minimal SVG containing a script or an event handler that produces an observable effect, such as a dialog or a request to a host you control.
- Open the uploaded file the way a normal user would: through the application's viewer, a direct link, or a preview. Watch whether the script runs and in which origin.
- Check the response headers for the stored file: the
Content-Type, anyContent-Disposition, and any sandboxing or CSP headers. A positive result is script execution in the application's origin, not on an isolated file host. - If the file is only reachable by other users, confirm the stored payload executes for a second account, which is what makes it stored rather than reflected.
Common false positives: the SVG renders but the script does not run because it is loaded through an <img> tag; the file is served from a separate domain with no session cookies; the browser blocks execution because of Content-Disposition: attachment or a sandbox attribute; or the payload only triggers in the uploader's own session, which is self-XSS and not a meaningful finding.
How it is fixed
The standard fixes are to sanitise uploaded SVGs by stripping scripts and event handlers, or to reject SVG uploads where they are not needed. Serving user files from a separate origin, forcing download rather than inline rendering, and adding a Content Security Policy that blocks inline script all reduce the impact. Validating the declared content type against the actual file content closes the extension-renaming bypass.
Hunting notes
Upload features are worth checking wherever users can attach files that other users will later view: chat attachments, avatars, support tickets, document previews and admin consoles. Recon signals include upload endpoints that accept a broad set of image types, preview functionality that renders files inline, and stored files served from the main application domain rather than a dedicated asset host.
What happened, in plain words
This report is about a chat management website, chat.line.biz, which is part of LINE Messenger's chat offering. A management interface is the web page where someone looks after their chat settings and files, a bit like the admin desk of a shop. The feature involved is file upload: the site let people upload files, including SVG files, and it did not properly filter or disable scripts hidden inside them.
An SVG is a picture format, but unlike a photo it is written as text, a bit like a recipe rather than a finished cake. That text can include instructions for the browser, and those instructions can include JavaScript, the language that makes web pages do things. So a file that looks like an innocent image can carry a small program inside it.
The attack path in the report is short:
- An attacker uploads an SVG file that contains JavaScript.
- Another user later opens that file in the management interface.
- The embedded script executes in that user's browser.
Why does each step matter? The first step is possible because the upload feature accepted the file. The second step is what makes the bug dangerous: the file is stored on the server, so it waits there until someone else opens it. The third step is the payoff: the script runs inside the victim's browser when they open the file.
Because the payload is stored on the server and runs when a different user views it, this is called stored cross-site scripting, or stored XSS. "Stored" means the malicious content lives on the server rather than being sent once in a link. "Cross-site scripting" means an attacker gets their own code to run inside someone else's session on a site. A session is the period during which a site remembers who you are, usually with a cookie, a small piece of data the browser keeps and sends back with each request, like a wristband at an event.
The report is rated low severity and a bounty of 100.00 USD was paid. The summary does not describe the exact upload endpoint, the request used, the payload, or the fix that was applied.
In general, how this kind of bug works
Stored XSS happens when content supplied by one user is saved and later shown to other users without adequate encoding or isolation. Encoding means turning special characters into harmless text so the browser displays them instead of acting on them. Isolation means keeping untrusted content away from the site's own trusted pages.
The classic case is a comment box: you type text, the site saves it, and later shows it to everyone. If the site does not encode it, your text can become live code. File uploads are a less obvious variant, because the danger depends on how the stored file is served back.
SVG is the usual culprit because it is both an image format and an XML document. XML is a text format for structured data, like a very strict form with labelled boxes. An SVG can contain <script> elements, onload and other event attributes, and references to external resources. When a browser loads an SVG as an image through an <img> tag, scripting is generally not executed. When the same file is opened directly, embedded in the page, or served with an HTML-ish content type, the script can run. The vulnerability therefore hinges on the delivery path: the content type, the Content-Disposition header, and whether the file is rendered inline in the application's own origin. The origin is the combination of scheme, host and port that the browser treats as one trust boundary, roughly the site's identity.
Defences work at several layers: rejecting or sanitising active content in uploaded SVGs, serving user files from a separate origin or sandboxed domain, forcing download with Content-Disposition: attachment, and applying a restrictive Content Security Policy, a set of rules telling the browser which scripts may run.
How to test for it
- Find upload features that accept images, documents, avatars or attachments, and check whether SVG is among the accepted types. Try changing the file extension and the declared content type if SVG is rejected outright.
- Upload a minimal SVG containing a script or an event handler that produces an observable effect, such as a dialog or a request to a host you control.
- Open the uploaded file the way a normal user would: through the application's viewer, a direct link, or a preview. Watch whether the script runs and in which origin.
- Check the response headers for the stored file: the
Content-Type, anyContent-Disposition, and any sandboxing or CSP headers. A positive result is script execution in the application's origin, not on an isolated file host. - If the file is only reachable by other users, confirm the stored payload executes for a second account, which is what makes it stored rather than reflected.
Common false positives: the SVG renders but the script does not run because it is loaded through an <img> tag; the file is served from a separate domain with no session cookies; the browser blocks execution because of Content-Disposition: attachment or a sandbox attribute; or the payload only triggers in the uploader's own session, which is self-XSS and not a meaningful finding.
How it is fixed
The standard fixes are to sanitise uploaded SVGs by stripping scripts and event handlers, or to reject SVG uploads where they are not needed. Serving user files from a separate origin, forcing download rather than inline rendering, and adding a Content Security Policy that blocks inline script all reduce the impact. Validating the declared content type against the actual file content closes the extension-renaming bypass.
Where to look
Upload features are worth checking wherever users can attach files that other users will later view: chat attachments, avatars, support tickets, document previews and admin consoles. Recon signals include upload endpoints that accept a broad set of image types, preview functionality that renders files inline, and stored files served from the main application domain rather than a dedicated asset host.
Glossary
- SVG: a picture format written as text, which can contain scripts and event handlers.
- JavaScript: the programming language that runs in web browsers and makes pages interactive.
- Script: a piece of code that a browser executes.
- Stored XSS: cross-site scripting where the malicious content is saved on the server and runs when another user views it.
- Cross-site scripting (XSS): getting an attacker's code to run inside another user's session on a website.
- Session: the period during which a site remembers who you are.
- Cookie: a small piece of data the browser stores and sends back to a site to identify a session.
- Endpoint: a specific address on a server that accepts requests, such as an upload URL.
- Request: a message a browser sends to a server asking for something.
- Response headers: extra information a server sends alongside a page or file, such as its type or how to handle it.
- Content type: the label telling the browser what kind of file it is receiving.
Content-Disposition: a header that tells the browser whether to display a file inline or download it.- Origin: the combination of scheme, host and port that the browser treats as one trust boundary.
- Encoding: turning special characters into harmless text so the browser displays them instead of acting on them.
- Sanitising: cleaning content by removing dangerous parts before it is stored or shown.
- Content Security Policy (CSP): rules telling the browser which scripts and resources are allowed.
- Sandbox: an isolated environment that limits what content can do.
- Self-XSS: a payload that only runs in the uploader's own session, which is not a meaningful finding.
- False positive: a result that looks like a bug but is not exploitable in practice.
- Severity: a rating of how serious a vulnerability is.
- Bounty: a payment made to a researcher for reporting a valid vulnerability.