Skip to content

Autofix test.js#79

Open
AlonaHlobina wants to merge 2 commits intomasterfrom
AlonaHlobina-patch-1
Open

Autofix test.js#79
AlonaHlobina wants to merge 2 commits intomasterfrom
AlonaHlobina-patch-1

Conversation

@AlonaHlobina
Copy link
Owner

No description provided.

@AlonaHlobina AlonaHlobina changed the title Autofix tast.js Autofix test.js Sep 25, 2023
let url = req.param('url'),
host = urlLib.parse(url).host;
// BAD: the host of `url` may be controlled by an attacker
let regex = /^((www|beta).)?example.com/;

Check failure

Code scanning / CodeQL

Incomplete regular expression for hostnames

This regular expression has an unescaped '.' before 'example.com', so it might match more hosts than expected.

document.write("Hello, world!");

document.write(window.location.search);

Check warning

Code scanning / CodeQL

Client-side cross-site scripting

Cross-site scripting vulnerability due to [user-provided value](1).

document.write(window.location.search);

document.write(window.location.search);

Check warning

Code scanning / CodeQL

Client-side cross-site scripting

Cross-site scripting vulnerability due to [user-provided value](1).


// It's a classic:
document.write(window.location.search)

Check warning

Code scanning / CodeQL

Client-side cross-site scripting

Cross-site scripting vulnerability due to [user-provided value](1).
// BAD: the host of `url` may be controlled by an attacker
let regex = /^((www|beta).)?example.com/;
if (host.match(regex)) {
res.redirect(url);

Check warning

Code scanning / CodeQL

Server-side URL redirect

Untrusted URL redirection depends on a [user-provided value](1).
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.

1 participant