XSS vulnerability on basin.exchange leads to potential session hijacking and unauthorized actions
Report ID
#35905
Report type
Websites and Applications
Has PoC?
Yes
Target
Impacts
- Injecting code that results in malicious interactions with an already-connected wallet such as modifying transaction arguments or parameters, substituting contract addresses, submitting malicious transactions
- Persistent content spoofing / text injection issues
Description
Brief/Intro
The website basin.exchange is vulnerable to Cross-Site Scripting (XSS) attacks. XSS is a security vulnerability that allows an attacker to inject malicious scripts into web pages viewed by other users.
Vulnerability Details
The vulnerability exists because the website does not properly sanitize user inputs, allowing malicious scripts to be injected and executed in the context of a user's browser session.
To demonstrate this vulnerability, several DOM Injection payloads were used to test for XSS vulnerabilities.
Impact Details
The potential impact of this vulnerability includes the execution of arbitrary scripts in the context of a user's session. This can lead to:
- Stealing session cookies
- Redirecting users to malicious websites
- Defacement of the website
The severity of this vulnerability is high, as it could lead to unauthorized actions on behalf of the user or data theft.
Risk Assessment
Based on CVSS v3, the severity of the XSS vulnerability is assessed as follows:
- Attack Vector: Network (The vulnerability can be exploited remotely over the internet)
- Attack Complexity: Low (The attack does not require special conditions and can be easily replicated)
- Privileges Required: None (No authentication is required to exploit the vulnerability)
- User Interaction: Required (The attack requires a user to visit the compromised page)
- Confidentiality Impact: High (The attacker can access sensitive information such as session cookies)
- Integrity Impact: High (The attacker can modify the content displayed to users)
- Availability Impact: Low (The attack may not directly impact the availability of the service)
CVSS v3 Score:Â 7.5 (High)
Recommendations for Remediation
For XSS Vulnerabilities:
- Input Validation: Validate all user inputs to ensure they conform to the expected format (e.g., length, allowed characters, etc.). Reject any unexpected input.
- Output Encoding: Encode all user inputs before rendering them on the web page to prevent malicious scripts from being executed.
- Content Security Policy (CSP): Implement CSP to restrict the sources from which content can be loaded, preventing the execution of injected scripts.
- HTTP Headers: Use security headers such asÂ
X-XSS-Protection to help protect against reflected XSS attacks. - Regular Security Testing: Conduct regular security audits and automated testing to identify potential XSS vulnerabilities.
References
- MDN Web Docs - Cross-Site Scripting (XSS):Â [https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting)
- Puppeteer Documentation:Â [https://pptr.dev](https://pptr.dev)
- OWASP XSS Prevention Cheat Sheet:Â [https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)
Proof of concept
The following XSS payloads were tested, and the results are shown below:
Tested Pages:
- https://basin.exchange/
- https://basin.exchange/build
- https://basin.exchange/build#/wells
- https://basin.exchange/build#/swap
XSS Payloads Used:
Testing Script:
BIC Response
We have closed this report and marked it as spam for the following reason:
Extremely low quality: Appears to be AI generated, and the provided POC just manipulates the DOM contents rather than demonstrating an XSS vulnerability.