Repository navigation
feat(javascript): Fix gap in Node.js crypto rules for RSA algorithms - #7
Conversation
|
Currently Claude is saying that some of the checks for variable chaining can cause false positives but the examples it gives are decently odd edge cases so I think they're fine to ignore: |
I read a similar Claude review and think I understand the nature of the potential false positive. After checking the deep expression operator in the Semgrep rule pattern documentation, I see how this could generate false positives but I think in this context the risk is acceptable. However, the same review also pointed out a lack of new tests to cover these additional patterns, which is more of a concern to me. The tests can be another way for us to evaluate the soundness of the generated code. |
|
Agree with Dominic on the tests. On the false positives: I tried an alternative that keeps the chained case and removes them. Instead of const signer = crypto.createSign('RSA-SHA256');
const ctx = { signer, hasher: crypto.createHash('sha256') };
ctx.hasher.update(d); // reported as RSA signing todayCould you apply that here and in #8, and add the alias case plus this negative to the fixtures? |
|
Addressed these comments and added some new tests. How do they look? |
isasmendiagus
left a comment
There was a problem hiding this comment.
LGTM, thanks for the extra fixtures.
Description
Claude flagged a gap in how the RSA algorithm rules catch double variable assignments. This PR fixes that.
AI Generated by: Claude (using Opus 5)
Type of change
Checklist
make testpasses locallyopengrep --validateNotes for reviewers
Header comments in these files were written by AI and likely inaccurate. View them as notes for the reviewer that may point to blind spots in the patterns. Take them with a grain of salt.