Skip to content
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

Typescript parsing does not recognise Parameter Properties #10042

Open
1 of 3 tasks
joshbouncesecurity opened this issue Apr 2, 2024 · 0 comments
Open
1 of 3 tasks

Typescript parsing does not recognise Parameter Properties #10042

joshbouncesecurity opened this issue Apr 2, 2024 · 0 comments
Labels

Comments

@joshbouncesecurity
Copy link

Describe the bug
Hey folks, I am trying to use Semgrep Pro with Typescript to detect control flow and I came across an interesting problem.

I have code where class properties are being declared as Parameter Properties. Semgrep does not seem to be able to follow the flow through a parameter property. (I should note that VS Code does not seem to have any problem following the flow).

To Reproduce
See an example here:
https://semgrep.dev/playground/r/6JUv0RL/semgrep_bouncesecurity.broken-parameter-properties

I have used unit tests to show what should be being detected.

Expected behavior
See the unit tests above, Semgrep Pro should be able to follow flow when a parameter property is used so this rule should have detected all 3 examples and not just 2 of them.

Note that in the real scenario, the classes being declared are in different files so the solution needs to be a cross-file solution.

Screenshots
N/A

What is the priority of the bug to you?

  • P0: blocking your adoption of Semgrep or workflow
  • P1: important to fix or quite annoying
  • P2: regular bug that should get fixed

Environment
N/A

Use case

Cross-file discovery of control flow to ascertain where we are vulnerable to a particular issue.

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

No branches or pull requests

2 participants