Skip to content

Redos (Regular Expression Denial of Service) at Code Extraction Block in significant-gravitas/autogpt

Moderate
ntindle published GHSA-m2wr-7m3r-p52c Feb 10, 2026

Package

significant-gravitas/autogpt

Affected versions

autogpt-platform-beta-v >= 0.4.0, <= 0.6.15

Patched versions

>=autogpt-platform-beta-v0.6.32

Description

Description

The autogpt is vulnerable to Regular Expression Denial of Service due to the use of regex at Code Extraction Block. The vulnerable code is:

pattern = (
    r"```(?:"
    + "|".join(
        re.escape(alias)
        for aliases in language_aliases.values()
        for alias in aliases
    )
    + r")\s+[\s\S]*?```"
)

and

pattern = re.compile(rf"```{language}\s+(.*?)```", re.DOTALL | re.IGNORECASE)

The two Regex are used containing the corresponding dangerous patterns \s+[\s\S]*? and \s+(.*?). They share a common characteristic — the combination of two adjacent quantifiers that can match the same space character (\s). As a result, an attacker can supply a long sequence of space characters to trigger excessive regex backtracking, potentially leading to a Denial of Service (DoS).

PoC

Attacker can exploit this vulnerability to conduct DoS attack by:

  • Create Code Extraction Block
image
  • Then, save the agent
image
  • Run the Python code below to generate a payload and save it to a file:
with open("output.txt", "w") as f:
    f.write("```html" + " " * 200000)
  • Copy the payload from this file
image
  • Paste into the text input → Click Save → Click Run
image
  • Observe that it take over 8 minutes to run successfully. Larger inputs will take more time.
image
  • Performing a few runs with the same input can cause CPU exhaustion.
image

Impact

An attacker can exploit this by providing maliciously crafted input strings. This forces the application into intensive processing, resulting in:

  • High CPU usage
  • Potential application downtime Effectively, this creates a Denial of Service (DoS) scenario.

Remediation

The sub-pattern \s+[\s\S]*? and \s+(.*?) can be replaced by [ \t]*\n([\s\S]*?)

Occurrences

https://github.com/Significant-Gravitas/AutoGPT/blob/master/autogpt_platform/backend/backend/blocks/code_extraction_block.py#L86-L96
https://github.com/Significant-Gravitas/AutoGPT/blob/master/autogpt_platform/backend/backend/blocks/code_extraction_block.py#L106-L109

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

CVE ID

CVE-2026-26006

Weaknesses

Inefficient Regular Expression Complexity

The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles. Learn more on MITRE.

Credits