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

[GHSA-hhq3-ff78-jv3g] loader-utils is vulnerable to Regular Expression Denial of Service (ReDoS) #2906

Closed

Conversation

NxPKG
Copy link

@NxPKG NxPKG commented Nov 1, 2023

Updates

  • Affected products
  • CWEs
  • Description

Comments

import re

def match_regex(regex, string, timeout=1):
  """Matches a regular expression against a string, with a timeout.

  Args:
    regex: The regular expression to match.
    string: The string to match against.
    timeout: The maximum amount of time to spend matching the regular expression.

  Returns:
    True if the regular expression matches the string, False otherwise.
  """

  regex = re.compile(regex, re.DOTALL)
  start_time = time.time()
  match = regex.match(string)
  end_time = time.time()
  if match and (end_time - start_time) <= timeout:
    return True
  else:
    return False

@github-actions github-actions bot changed the base branch from main to NxPKG/advisory-improvement-2906 November 1, 2023 23:25
@shelbyc
Copy link
Contributor

shelbyc commented Nov 6, 2023

👋 Hi @NxPKG, thank you for your interest in GHSA-hhq3-ff78-jv3g, but we don't include general remediation advice for classes of vulnerabilities in GitHub Security Advisories unless the maintainer includes the advice in their repository advisory. Have a good week!

@github-actions github-actions bot deleted the NxPKG-GHSA-hhq3-ff78-jv3g branch December 28, 2023 18:57
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 this pull request may close these issues.

2 participants