Skip to content

Path Traversal in com.linecorp.armeria:armeria

High severity GitHub Reviewed Published Dec 2, 2021 in line/armeria • Updated Feb 1, 2023

Package

maven com.linecorp.armeria:armeria (Maven)

Affected versions

>= 1.12.0, < 1.13.4

Patched versions

1.13.4

Description

Impact

An attacker can access an Armeria server's local file system beyond its restricted directory by sending an HTTP request whose path contains %2F (encoded /), such as /files/..%2Fsecrets.txt, bypassing Armeria's path validation logic.

Patches

Armeria 1.13.4 or above contains the hardened path validation logic that handles %2F properly.

Workarounds

This vulnerability can be worked around by inserting a decorator that performs an additional validation on the request path, e.g.

Server
  .builder()
  .serviceUnder(
    "/files",
    FileService
      .of(...)
      .decorate((delegate, ctx, req) -> {
        String path = req.headers().path();
        if (path.contains("%2f") || path.contains("%2F")) {
          return HttpResponse.of(HttpStatus.BAD_REQUEST);
        }
        return delegate.serve(ctx, req);
      })
  )
  .build()

For more information

If you have any questions or comments about this advisory:

Credits

This vulnerability was originally reported by Abdallah Zaher (elcayser-0x0a).

References

@trustin trustin published to line/armeria Dec 2, 2021
Published by the National Vulnerability Database Dec 2, 2021
Reviewed Dec 2, 2021
Published to the GitHub Advisory Database Dec 2, 2021
Last updated Feb 1, 2023

Severity

High

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
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

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:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

0.128%
(48th percentile)

Weaknesses

CVE ID

CVE-2021-43795

GHSA ID

GHSA-8fp4-rp6c-5gcv

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.