skip to content
Back to GitHub.com
Home Bounties Research Advisories CodeQL Wall of Fame Get Involved Events
January 12, 2022

GHSL-2021-119: ReDoS (Regular Expression Denial of Service) in H20

Kevin Backhouse

Coordinated Disclosure Timeline

Summary

H2O contains a regular expression that is vulnerable to ReDoS (Regular Expression Denial of Service).

Product

H2O

Tested Version

jenkins-master-5549

Details

ReDoS

ReDoS, or Regular Expression Denial of Service, is a vulnerability affecting inefficient regular expressions which can perform extremely badly when run on a crafted input string.

This vulnerability was found using a CodeQL query which identifies inefficient regular expressions.

Vulnerability

The vulnerable regular expression is here.

To see that the regular expression is vulnerable, copy-paste it into a separate file as shown below:

import re
reg = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I);
reg.match(",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Negotiaet,"); # `Negotiate` is misspelled on purpose, to make sure the regexp doesn't match.

Impact

This issue may lead to a denial of service.

Credit

This issue was discovered by GitHub team members @erik-krogh (Erik Krogh Kristensen) and @yoff (Rasmus Petersen).

Contact

You can contact the GHSL team at securitylab@github.com, please include a reference to GHSL-2021-119 in any communication regarding this issue.