Skip to content

JavaScript: Fix a bug in ServerSideUrlRedirect #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2018

Conversation

asger-semmle
Copy link
Contributor

The server-side redirect query did not handle sinks in this case:

function f(res, nextUrl) {
  res.redirect(nextUrl);
}

because the logic in Sink.maybeNonLocal() required that a prefix of the sink must be an Expr. In this case, the prefix is found to be a ParameterNode whose asExpr() has no result.

I've refactored getAPrefix to return a DataFlow::Node and only coerce to Expr when doing getStringValue().

@asger-semmle asger-semmle requested a review from a team as a code owner October 1, 2018 11:39
Copy link

@xiemaisi xiemaisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xiemaisi xiemaisi added the JS label Oct 2, 2018
@semmle-qlci semmle-qlci merged commit 829a5cc into github:master Oct 2, 2018
aibaars pushed a commit that referenced this pull request Oct 14, 2021
Don't include desugared nodes in the printed AST
smowton added a commit to smowton/codeql that referenced this pull request Apr 16, 2022
…ava-type-subs

Remove inapplicable TODO re: K<->J type substitution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants