Skip to content

Rb: add case-when expressions as a sink to rb/polynomial-redos #10798

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 2 commits into from
Oct 13, 2022

Conversation

erik-krogh
Copy link
Contributor

@erik-krogh erik-krogh commented Oct 12, 2022

CVE-2021-22880: Recognizes the sink (TP with #10782).
CVE-2022-30122: One step closer to the sink.

Evaluation looks OK.
There is a hint towards a performance regression, but I couldn't replicate locally.
And a repeat shows a smaller regression, and in other projects 🤷

@github-actions github-actions bot added the Ruby label Oct 12, 2022
@erik-krogh erik-krogh added the no-change-note-required This PR does not need a change note label Oct 12, 2022
@erik-krogh erik-krogh marked this pull request as ready for review October 12, 2022 21:11
@erik-krogh erik-krogh requested a review from a team as a code owner October 12, 2022 21:11
aibaars
aibaars previously approved these changes Oct 13, 2022
Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

Looks good to me. We may want to do the same for in clauses like

foo = "foo"
case foo
  in /f.+/ then ...
end

matchNode.asExpr() = caseWhen and
this.asExpr() = caseWhen.getValue() and
regexp.asExpr() =
caseWhen.getBranch(_).(CfgNodes::ExprNodes::WhenClauseCfgNode).getPattern(_)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we also add regular expressions in InClauses?

@erik-krogh
Copy link
Contributor Author

A new evaluation came in, it looks the same as the previous evaluation.

Merging.

@erik-krogh erik-krogh merged commit 3a1a94b into github:main Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants