semgrep / semgrep

Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.
https://semgrep.dev
GNU Lesser General Public License v2.1
10.06k stars 584 forks source link

ellipsis metavariable not matching with pattern-inside #9109

Open iacore opened 8 months ago

iacore commented 8 months ago

Describe the bug Named ellipsis not working the same as ellipsis.

To Reproduce https://semgrep.dev/playground/s/BZ35

Expected behavior There should be one match.

If you replace $...ARGS with ... it works.

What is the priority of the bug to you?

Use case Printing function argument in messages

gabe-gfm commented 2 months ago

This bug is also holding back some community rules, such as dockerfile.security.missing-user.missing-user.

It appears that a metavariable match was added to power an auto-fix section... but it was left with a failed test case that was disabled with a comment: # TODO: metavar ellipses bug

https://semgrep.dev/playground/r/dockerfile.security.missing-user.missing-user