Impact
A heap-buffer-overflow read could happen if using the re
module with a regular expression containing (*scs:...)
syntax (Scan SubString) combined with (*ACCEPT)
syntax.
Example: re:run("abbb", "(a)(*scs:(1)a(*ACCEPT))bbb").
This vulnerability may potentially lead to information disclosure if the out-of-bounds data read affects the final match result in a way observable by the attacker. It could also potentially cause denial-of-service by crashing the Erlang runtime process.
Note that it in the general case is a very bad idea to execute an unchecked regular expression from an untrusted user since this might cause other security issues like, for example, resource exhaustion.
The actual bug exists in statically linked PCRE2 version 10.45 and is reported by CVE-2025-58050.
Workarounds
Avoid using regular expressions containing (*scs:)
and (*ACCEPT)
combinations.
Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies an expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the new OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.
Impact
A heap-buffer-overflow read could happen if using the
re
module with a regular expression containing(*scs:...)
syntax (Scan SubString) combined with(*ACCEPT)
syntax.Example:
re:run("abbb", "(a)(*scs:(1)a(*ACCEPT))bbb").
This vulnerability may potentially lead to information disclosure if the out-of-bounds data read affects the final match result in a way observable by the attacker. It could also potentially cause denial-of-service by crashing the Erlang runtime process.
Note that it in the general case is a very bad idea to execute an unchecked regular expression from an untrusted user since this might cause other security issues like, for example, resource exhaustion.
The actual bug exists in statically linked PCRE2 version 10.45 and is reported by CVE-2025-58050.
Workarounds
Avoid using regular expressions containing
(*scs:)
and(*ACCEPT)
combinations.Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies an expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the new OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.