Skip to content

Add request parameters as sources for DOM-based XSS check#286

Open
faf0-addepar wants to merge 3 commits intos0md3v:masterfrom
faf0-addepar:faf0/params-as-sources
Open

Add request parameters as sources for DOM-based XSS check#286
faf0-addepar wants to merge 3 commits intos0md3v:masterfrom
faf0-addepar:faf0/params-as-sources

Conversation

@faf0-addepar
Copy link
Copy Markdown
Contributor

@faf0-addepar faf0-addepar commented Dec 31, 2019

What does it implement/fix? Explain your changes.

Currently, the DOM-based XSS checker doesn't consider request parameters
as an input source.
This change allows the DOM-based XSS checker to detect code injected via
request parameters.

Where has this been tested?

Python Version: 3.7.5
Operating System: macOS

Does this close any currently open issues?

No

Does this add any new dependency?

No

Does this add any new command line switch/option?

No

Any other comments you would like to make?

#285 should be merged first, as this change relies on it.

Some Questions

  • I have documented my code.
  • I have tested my build before submitting the pull request.

The DOM scanner colors sources and sinks in script lines.  Moreover,
that scanner collects all colored lines:
https://github.com/s0md3v/XSStrike/blob/0ecedc1bba149931e3b32e53422d5b7c089ba9dc/core/dom.py#L50

As coloring is disabled on Windows, macOS, and iOS, no potentially
tainted lines will be collected on these platforms:
https://github.com/s0md3v/XSStrike/blob/0ecedc1bba149931e3b32e53422d5b7c089ba9dc/core/colors.py#L8-L9
Consequently, the report of potential DOM vulnerabilities is always
empty.

This change fixes this bug by surrounding sources and sinks with `*`
characters.

Also, this change removes unused colors imports.
Currently, the DOM-based XSS checker doesn't consider request parameters
as an input source.
This change allows the DOM-based XSS checker to detect code injected via
request parameters.
@faf0-addepar faf0-addepar changed the title Faf0/params as sources Add request parameters as sources for DOM-based XSS check Dec 31, 2019
@faf0-addepar faf0-addepar requested a review from s0md3v January 24, 2020 14:40
@faf0-addepar
Copy link
Copy Markdown
Contributor Author

@s0md3v please review when you have a moment

@ItsIgnacioPortal
Copy link
Copy Markdown

Since @s0md3v seems to have abandoned this project, I've gone ahead and took the liberty to make a fork: XSStrike-Reborn
Your pull request has been merged into that project. Your efforts are appreciated 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants