CVE-2026-14895: String::Util versions before 1.36 for Perl are susceptible to a regular expression denial of service

Published Jul 7, 2026
·
Updated

String::Util versions before 1.36 for Perl are susceptible to a regular expression denial of service.

The trim and rtrim functions stripped trailing whitespace with s/\s$//u. Because \s matches greedily and the $ anchor fails whenever a non-whitespace character follows the whitespace, the regex engine retries the match at each offset of a long whitespace run, producing quadratic backtracking. The fix replaces \s$ with \s+$.

Any caller that passes untrusted input to trim or rtrim can trigger CPU exhaustion with a string containing a long run of whitespace.

Affected Software

1 affected component
Perl String::Util<1.36

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Perl String::Util to a version that resolves this vulnerability.

    Fixed in 1.36
  2. Configuration

    Update the trim/rtrim implementation to use `s/\s+//u` (the fix replaces `\s*$` with `\s+$`) instead of stripping trailing whitespace using `s/\s*$//u`.

    String::Util (trim/rtrim) regex used for stripping trailing whitespace = replace `s/\s*$//u` with `s/\s+//u`

Event History

Jul 7, 2026
CVE Published
via MITRE·10:12 PM
Data Sourced
via MITRE·10:12 PM
RemedyDescriptionWeakness
Data Sourced
via NVD·11:16 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-14895?

The severity of CVE-2026-14895 is rated at 28.

2

How do I fix CVE-2026-14895?

To fix CVE-2026-14895, upgrade to String::Util version 1.36 or later.

3

What vulnerability does CVE-2026-14895 address?

CVE-2026-14895 addresses a regular expression denial of service in String::Util versions before 1.36.

4

Which functions in String::Util are affected by CVE-2026-14895?

The trim and rtrim functions in String::Util are affected by CVE-2026-14895.

5

Is CVE-2026-14895 relevant to all Perl applications?

CVE-2026-14895 is relevant only to Perl applications using vulnerable versions of String::Util.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203