Vulnerabilities in pkg:maven/com.linecorp.armeria/armeria

PACKAGE
Advisory Identifier: GHSA-24r8-fm9r-cpj2
Advisory Summary

CVE-2019-16771 is a MODERATE (CVSS 4.8) armeria vulnerability (CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')) affecting Armeria libraries in the Maven ecosystem. The issue involves armeria. Remediation is available by upgrading affected packages to version 0.97.0.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/com.linecorp.armeria/armeria

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/com.linecorp.armeria/armeria. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-24r8-fm9r-cpj2 CVE-2019-16771 MODERATE Low severity vulnerability that affects com.linecorp.armeria:armeria
GHSA-wvp2-9ppw-337j CVE-2023-38493 HIGH Paths contain matrix variables bypass decorators
GHSA-8fp4-rp6c-5gcv CVE-2021-43795 HIGH Path Traversal in com.linecorp.armeria:armeria
GHSA-35fr-h7jr-hh86 - MODERATE Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting') in Armeria

CVE-2019-16771 at a Glance

CVE Identifier CVE-2019-16771
GHSA Identifier GHSA-24r8-fm9r-cpj2
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')
Affected Product Armeria
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2019-16771

To remediate this vulnerability, upgrade all affected Armeria dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

com.linecorp.armeria:armeria fixed: 0.97.0
<dependency>
    <groupId>com.linecorp.armeria</groupId>
    <artifactId>armeria</artifactId>
    <version>0.97.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=com.linecorp.armeria

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2019-16771, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=com.linecorp.armeria

Analyze the terminal output to locate any version of Armeria in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.97.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=com.linecorp.armeria command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting'), where the product receives data from an http agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes cr and lf characters before the data is included in outgoing http headers. In Armeria, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Multiple timing attack vulnerabilities leading to the recovery of secrets based on the use of non-constant time compare function ### Impact String comparison method in multiple authentication validation in Armeria were known to be vulnerable to timing attacks. This vulnerability is caused by the insecure implementation of `equals` method from `java.lang.String`. While this attack is not practically possible, an attacker still has a potential to attack if the victim's server validates user by using `equals` method. We would like to thank @chrsow for pointing out the issue. ## Potentially vulnerable codes https://github.com/line/armeria/blob/f0d870fde1088114070be31b67f7df0a21e835c6/core/src/main/java/com/linecorp/armeria/server/auth/OAuth2Token.java#L54 https://github.com/line/armeria/blob/f0d870fde1088114070be31b67f7df0a21e835c6/core/src/main/java/com/linecorp/armeria/server/auth/BasicToken.java#L64 ### Patches There are two options to patch this issue. 1. Remove `equals` method; it has been exclusively used for test cases and was never used in any OSS projects that are using Armeria. (But it is worth noting that there are possibilities of closed projects authenticating users by utilizing `equals` method) 2. Use `MessageDigest.isEqual` to compare the credential instead. ### Workarounds 1. Update to the latest version (TBD) 2-1. Users can prevent these vulnerabilities by modifying and implementing timing attack preventions by themselves. 2-2. Precisely speaking, it is possible to compare credentials by securely comparing them after calling methods to directly return the input (namely `Object. accessToken()`, `Object.username()` and `Object.password()`). ### References - https://cwe.mitre.org/data/definitions/208.html - https://security.stackexchange.com/questions/111040/should-i-worry-about-remote-timing-attacks-on-string-comparison ### Side Note Since it is a theoretical attack, there is no PoC available from neither the vendor nor the security team.

CVE-2019-16771 Affected Armeria Versions

1 component(s)
Fixed Versions:
0.97.0
Product / Package Ecosystem Affected Versions Fixed Version
com.linecorp.armeria:armeria
Maven
≥ 0.50.0
< 0.97.0
0.97.0

References

Frequently Asked Questions

What is CVE-2019-16771?
CVE-2019-16771 is a security vulnerability in Armeria involving armeria under CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting').
Which Armeria versions are affected?
Affected versions include releases prior to 0.97.0 across affected packages: com.linecorp.armeria:armeria.
What version fixes CVE-2019-16771?
Upgrading to 0.97.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is armeria affected?
Yes, com.linecorp.armeria:armeria is affected in releases prior to 0.97.0. Upgrade your dependency to 0.97.0 or later.
What is the CVSS score of CVE-2019-16771?
CVE-2019-16771 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2019-16771?
CVE-2019-16771 is classified under CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') (The product receives data from an HTTP agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.).
How can I check Maven dependencies for CVE-2019-16771?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.linecorp.armeria'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-24r8-fm9r-cpj2",
  "modified" : "2024-05-15T06:34:23Z",
  "published" : "2019-12-05T18:40:51Z",
  "aliases" : [ "CVE-2019-16771" ],
  "summary" : "Low severity vulnerability that affects com.linecorp.armeria:armeria",
  "details" : "## Multiple timing attack vulnerabilities leading to the recovery of secrets based on the use of non-constant time compare function\n\n### Impact\n\nString comparison method in multiple authentication validation in Armeria were known to be vulnerable to timing attacks. This vulnerability is caused by the insecure implementation of `equals` method from `java.lang.String`. While this attack is not practically possible, an attacker still has a potential to attack if the victim's server validates user by using `equals` method.\n\nWe would like to thank @chrsow for pointing out the issue.\n\n## Potentially vulnerable codes\n\nhttps://github.com/line/armeria/blob/f0d870fde1088114070be31b67f7df0a21e835c6/core/src/main/java/com/linecorp/armeria/server/auth/OAuth2Token.java#L54\nhttps://github.com/line/armeria/blob/f0d870fde1088114070be31b67f7df0a21e835c6/core/src/main/java/com/linecorp/armeria/server/auth/BasicToken.java#L64\n\n### Patches\n\nThere are two options to patch this issue.\n\n1. Remove `equals` method; it has been exclusively used for test cases and was never used in any OSS projects that are using Armeria. (But it is worth noting that there are possibilities of closed projects authenticating users by utilizing `equals` method)\n\n2. Use `MessageDigest.isEqual` to compare the credential instead.\n\n### Workarounds\n\n1. Update to the latest version (TBD)\n\n2-1. Users can prevent these vulnerabilities by modifying and implementing timing attack preventions by themselves.\n\n2-2. Precisely speaking, it is possible to compare credentials by securely comparing them after calling methods to directly return the input (namely `Object. accessToken()`, `Object.username()` and `Object.password()`).\n\n### References\n- https://cwe.mitre.org/data/definitions/208.html\n- https://security.stackexchange.com/questions/111040/should-i-worry-about-remote-timing-attacks-on-string-comparison\n\n### Side Note\n\nSince it is a theoretical attack, there is no PoC available from neither the vendor nor the security team.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.linecorp.armeria:armeria"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.50.0"
      }, {
        "fixed" : "0.97.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/line/armeria/security/advisories/GHSA-24r8-fm9r-cpj2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/line/armeria/security/advisories/GHSA-35fr-h7jr-hh86"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-16771"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/line/armeria/commit/b597f7a865a527a84ee3d6937075cfbb4470ed20"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-24r8-fm9r-cpj2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-113" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:51:26Z",
    "nvd_published_at" : null
  }
}