CVE-2021-43795
JSON

7.5high

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in com.linecorp.armeria:armeria

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
1.71% (higher than 78% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-8fp4-rp6c-5gcv

Description

Armeria is an open source microservice framework. In affected versions 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. Armeria 1.13.4 or above contains the hardened path validation logic that handles `%2F` properly. This vulnerability can be worked around by inserting a decorator that performs an additional validation on the request path.

Affected

Product or packageVersionsReported by
line armeria< 1.13.4CVE List
com.linecorp.armeria:armeria (Maven)from 1.12.0 before 1.13.4GitHub Advisory Database
linecorp armeriabefore 1.13.4NVD

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:P/I:N/A:N

Classification

What each source says

CVE List

Armeria is an open source microservice framework. In affected versions 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. Armeria 1.13.4 or above contains the hardened path validation logic that handles `%2F` properly. This vulnerability can be worked around by inserting a decorator that performs an additional validation on the request path.

GitHub Advisory Database
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).

NVD (es)

Armeria es un framework de microservicios de código abierto. En las versiones afectadas, un atacante puede acceder al sistema de archivos local de un servidor de Armeria más allá de su directorio restringido mediante el envío de una petición HTTP cuya ruta contenga "%2F" (codificado "/"), como "/files/..%2Fsecrets.txt", omitiendo la lógica de comprobación de rutas de Armeria. Armeria versión 1.13.4 o superior, contiene una lógica de comprobación de rutas reforzada que maneja "%2F" apropiadamente. Esta vulnerabilidad puede solucionarse al insertar un decorador que lleve a cabo una comprobación adicional en la ruta de petición

References

Sources

SourceRecordLicence
CVE ListCVE-2021-43795 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-8fp4-rp6c-5gcv changed 2026-07-08CC-BY-4.0
NVDCVE-2021-43795 changed 2026-06-17Public domain