(possible falsepositive) XSS in /web:requirements/base.txt
- Dominant language
- JavaScript
- Stars
- 1.8k
- Forks
- 776
- PR merge metrics
- No merged PRs in 30d
Description
Overview
MKDOCS is a Project documentation with Markdown.
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) when using the search function in built-in themes.
Details
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
Prevent isssu:
https://github.com/mkdocs/mkdocs/commit/5cf196361bb0f8364f667ed98888ffa064982efa
More fixes:
How to prevent
This section describes the top best practices designed to specifically protect your code:
Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
Give users the option to disable client-side scripts.
Redirect invalid requests.
Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
More info:
https://github.com/mkdocs/mkdocs/commit/5cf196361bb0f8364f667ed98888ffa064982efa
https://security.snyk.io/vuln/SNYK-PYTHON-MKDOCS-2438396
Contributor guide
Research direction
Start by inspecting /web:requirements/base.txt and compare the MKDOCS version with the referenced prevention commit and Snyk advisory. Confirm whether the reported XSS affects this project and document whether a dependency change is needed; the issue is done when the false-positive status or required fix is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100