CVE-2021-43795
Path Traversal in com.linecorp.armeria:armeria
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:
- Open an issue in line/armeria
- Chat with us at Slack
Credits
This vulnerability was originally reported by Abdallah Zaher (elcayser-0x0a).
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| com.linecorp.armeria » armeria | >= 1.12.0, < 1.13.4 | 1.13.4 |
Blast radius
3% of the dependent artifacts (4) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 280 |
| 2 hops | 72 |
| 3 hops | 46 |
| 4 hops | 40 |
| 5 hops | 20 |
| 6 hops | 2 |
Most used dependents
- org.apache.skywalking » server-core38 usages
- com.linecorp.armeria » armeria-grpc36 usages
- com.linecorp.armeria » armeria-logback18 usages
- org.apache.skywalking » library-client16 usages
- com.linecorp.armeria » armeria-junit414 usages
- com.linecorp.armeria » armeria-junit514 usages
- com.linecorp.armeria » armeria-retrofit213 usages
- com.linecorp.centraldogma » centraldogma-client-armeria10 usages
- com.softwaremill.sttp.client3 » armeria-backend10 usages
- com.linecorp.armeria » armeria-grpc-protocol9 usages
- com.linecorp.centraldogma » centraldogma-server8 usages
- io.zipkin.zipkin2 » zipkin-storage-elasticsearch8 usages
- com.linecorp.armeria » armeria-kotlin7 usages
- com.linecorp.armeria » armeria-rxjava37 usages
- org.apache.skywalking » agent-analyzer7 usages
Computed from the dependency graph of build 20261202.0245 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2021-43795 | nvd.nist.gov |
| Package | line/armeria | github.com |
| Web | line/armeria advisory GHSA-8fp4-rp6c-5gcv | github.com |
| Web | line/armeria pull request #3855 | github.com |
| Web | line/armeria commit e2697a5 | github.com |
