Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
OpenTrade Dom-Based XSS Disclosure
[Vulnerability Description]
OpenTrade through version 0.2.0 has a Dom-based XSS vulnerability that is executed when an administrator attempts to delete a message that contains Javascript.
[Application Description]
OpenTrade is an open source crypto currency exchange that can support over a dozen cryptocurrencies. Its live version can be found at
[Affected Versions]
The following commit introduced the vulnerability, but OpenTrade did not have a package.json with applicable versioning:
Officially version 0.2.0 of OpenTrade is the only "vulnerable" version, as it is the first committed version number in package.json
When an administrator attempts to delete a chat message, a modal is opened asking the administrator to confirm the deletion.
This modal does not HTML or URL encode the message contents, allowing Javascript to be executed in the context of the administrator's browser if the message contained Javascript.
Affected line:
Due to OpenTrade not setting the "token" (session) cookie with the "HTTPOnly" flag, this allows an attacker to steal administrator's sessions.
[Proof of Concept]
As a normal user:
*) Submit a chat message with Javascript contents, e.g. <script>alert()</script> (this will not execute in the chat box).
As an administrator:
*) Attempt to delete the message containing Javascript by clicking the X delete button to the right of the message.
*) Clicking this button will trigger the Javascript instantly, as the unencoded message has been loaded into a modal.
Apply encodeURI() to message output
CVSS (proposed): 7.6 (High) -
Vulnerability Type: Dom-Based Cross-Site Scripting (XSS)
Discoverer: Marshall Hallenbeck (@mjhallenbeck)
CVE: CVE-2020-6847 (
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment