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

Add timeouts to all regular expressions #8314

Closed
andrei-epure-sonarsource opened this issue Nov 3, 2023 · 1 comment · Fixed by #8431
Closed

Add timeouts to all regular expressions #8314

andrei-epure-sonarsource opened this issue Nov 3, 2023 · 1 comment · Fixed by #8431
Assignees
Milestone

Comments

@andrei-epure-sonarsource
Copy link
Contributor

We have 22 security hotspots because of not using regex timeouts.

We should use a timeout for all. I'd say that 500 ms should ensure we won't be too strict without having some data to rely on. We don't search for patterns in whole files, we only limit it to syntax nodes. Even 500 ms seems a lot, but we 'd need to do tests on various hardware to find a good value.

The source generator should be treated separately.

@martin-strecker-sonarsource
Copy link
Contributor

We already have:

public static TimeSpan DefaultTimeout => TimeSpan.FromMilliseconds(100);

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

Successfully merging a pull request may close this issue.

3 participants