Skip to content

Conversation

@fzipi
Copy link
Member

@fzipi fzipi commented Jun 3, 2024

what

  • update regex to be more specific
  • change semantic from . (anything) to [^\(\)], which performs better while keeping the meaning

why

  • follow standards
  • optimize matching speed
  • prevent potential backtrackings

@fzipi fzipi requested a review from theseion June 3, 2024 19:43
@fzipi fzipi force-pushed the rules/932130-use-lazy-regex branch from f65f101 to 4b8806d Compare June 3, 2024 20:19
@github-actions github-actions bot added the Stale label Jul 24, 2024
@github-actions github-actions bot closed this Aug 8, 2024
@azurit azurit reopened this Aug 8, 2024
@azurit azurit removed the Stale label Aug 8, 2024
@github-actions github-actions bot added the Stale label Sep 8, 2024
@fzipi fzipi removed the Stale label Sep 16, 2024
@fzipi fzipi force-pushed the rules/932130-use-lazy-regex branch from 4b8806d to 16b9ad7 Compare September 17, 2024 13:27
@fzipi fzipi marked this pull request as ready for review September 17, 2024 13:28
@fzipi
Copy link
Member Author

fzipi commented Sep 17, 2024

Ugh, looks like a[b///]c works as a glob.

@Xhoenix
Copy link
Member

Xhoenix commented Nov 2, 2024

I tried a[b///]c on regex101 but couldn't reproduce a glob. How it works.

@fzipi
Copy link
Member Author

fzipi commented Nov 2, 2024

mkdir abc
touch abc/myfile.txt
ls a[b///]c
myfile.txt

@Xhoenix
Copy link
Member

Xhoenix commented Nov 2, 2024

Didn't knew you meant it in shell context. I thought in regex terms. 🙂

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2024

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

@Xhoenix Xhoenix removed the Stale label May 15, 2025
@github-actions github-actions bot added the Stale label Jun 15, 2025
@fzipi fzipi force-pushed the rules/932130-use-lazy-regex branch from 9c570f7 to b51d25d Compare June 21, 2025 13:56
Comment on lines +14 to +17
\$\([^()]*\)
\$\{[^{}]*\}
<\([^()]*\)
>\([^()]*\)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
\$\([^()]*\)
\$\{[^{}]*\}
<\([^()]*\)
>\([^()]*\)
\$\([^()]+\)
\$\{[^{}]+\}
<\([^()]+\)
>\([^()]+\)

We should expect atleast one character for command execution, $() or ${} will result in nothing for the attacker.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants