-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOM-Based XSS Vulnerability Disclosure: DeepSeek.com #514
Comments
I noticed that the copyright comment in the PoC payload has been removed. Kindly ensure that a proper copyright notice is added, referencing my write-up post at: Thank you for your attention to this matter. |
Are you trying to hack Similar expert #470 |
Hello, It appears we may of gotten the same vuln, I do apologize if you did find it. I found it yesterday, with 2 other researchers. overall, good job on your PoC! |
We may of utilized the same exact references, as you may of used. We're looking to follow up further, as we have noticed another based Reflected XSS on the Chat Window |
Summary
During routine analysis, a DOM-based Cross-Site Scripting (XSS) vulnerability was identified on DeepSeek's CDN endpoint:
https://cdn.deepseek.com/usercontent/usercontent.html
. The vulnerability stems from improper handling ofpostMessage
events, allowing an attacker to inject malicious scripts into the document context without proper origin validation or input sanitization.Affected URL
https://cdn.deepseek.com/usercontent/usercontent.html
Vulnerability Details
The
postMessage
implementation on the affected endpoint processes messages without verifying their origin or properly sanitizing input. The following code snippet illustrates the root cause of the issue:The function directly writes any
__deepseekCodeBlock
payload into the document usingdocument.write
, bypassing essential security measures such as:postMessage
event originates from a trusted source.Proof of Concept (PoC)
Payload:
The following
postMessage
payload can exploit the vulnerability to execute arbitrary JavaScript:Exploit Code:
For easier testing, an iframe-based PoC was created to demonstrate the issue:
Impact:
When this payload is executed:
origin
, confirming the ability to inject and execute arbitrary JavaScript.Steps to Reproduce
https://cdn.deepseek.com/usercontent/usercontent.html
in your browser.Recommendations
Validate Message Origin: Ensure that the
postMessage
event'sorigin
matcheshttps://cdn.deepseek.com
:Sanitize User Input: Use a library like DOMPurify to sanitize the HTML content before inserting it into the DOM. This helps prevent XSS attacks:
Avoid
document.write
: Replacedocument.write
with modern DOM manipulation methods:Timeline
Impact Assessment
This vulnerability allows attackers to execute arbitrary JavaScript in the context of
cdn.deepseek.com
. Potential impacts include:Appears @namcoder also found similar, credit is provided to him as well.
The text was updated successfully, but these errors were encountered: