Vulnerabilities in pkg:maven/lambdaisland/uri
PACKAGECVE-2023-28628 is a MODERATE (CVSS 6.5) lambdaisland/uri `authority-regex` returns the wrong vulnerability (CWE-706: Use of Incorrectly-Resolved Name or Reference) affecting Uri libraries in the Maven ecosystem. The issue involves lambdaisland/uri `authority-regex` returns the wrong authority. Remediation is available by upgrading affected packages to version 1.14.120.
pkg:maven/lambdaisland/uri
Vulnerability advisories affecting package pkg:maven/lambdaisland/uri. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-cp4w-6x4w-v2h5 | CVE-2023-28628 | MODERATE | lambdaisland/uri `authority-regex` returns the wrong authority |
CVE-2023-28628 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2023-28628
To remediate this vulnerability, upgrade all affected Uri dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>lambdaisland</groupId>
<artifactId>uri</artifactId>
<version>1.14.120</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=lambdaisland
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2023-28628, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=lambdaisland
Analyze the terminal output to locate any version of Uri in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.14.120), your application is affected.
Note: The mvn dependency:tree -Dincludes=lambdaisland 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-706: Use of Incorrectly-Resolved Name or Reference, where the product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere. In Uri, 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
CVE-2023-28628 Affected Uri Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
lambdaisland:uri
|
Maven |
< 1.14.120
|
1.14.120
|
References
Frequently Asked Questions
What is CVE-2023-28628?
Which Uri versions are affected?
What version fixes CVE-2023-28628?
Is uri affected?
What is the CVSS score of CVE-2023-28628?
What CWE is associated with CVE-2023-28628?
How can I check Maven dependencies for CVE-2023-28628?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cp4w-6x4w-v2h5",
"modified" : "2023-03-27T22:31:13Z",
"published" : "2023-03-27T22:31:13Z",
"aliases" : [ "CVE-2023-28628" ],
"summary" : "lambdaisland/uri `authority-regex` returns the wrong authority",
"details" : "### Summary\n`authority-regex` allows an attacker to send malicious URLs to be parsed by the `lambdaisland/uri` and return the wrong authority. This issue is similar to CVE-2020-8910.\n\n### Details\n\nhttps://github.com/lambdaisland/uri/blob/d3355fcd3e235238f4dcd37be97787a84e580072/src/lambdaisland/uri.cljc#L9\n\nThis regex doesn't handle the backslash (`\\`) character in the username correctly, leading to a wrong output.\n**Payload:** `https://example.com\\\\@google.com`\nThe returned host is `google.com`, but the correct host should be `example.com`.\n\n`urllib3` (Python) and `google-closure-library` (Javascript) return `example.com` as the host. Here the correct (or current) regex used by `google-closure-library`:\n\nhttps://github.com/google/closure-library/blob/0e567abedb058e9b194a40cfa3ad4c507653bccf/closure/goog/uri/utils.js#L189\n\n### PoC\n\n```\n(ns poc.core)\n(require '[lambdaisland.uri :refer (uri)])\n\n(def myurl \"https://example.com\\\\@google.com\")\n\n(defn -main\n []\n (println myurl)\n (println (:host (uri myurl)))\n)\n```\n\n\n### Impact\n\nThe library returns the wrong authority, and it can be abused to bypass host restrictions.\n\n### Reference\n\nWHATWG Living URL spec, section 4.4 URL Parsing, host state: https://url.spec.whatwg.org/#url-parsing",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "lambdaisland:uri"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.14.120"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/lambdaisland/uri/security/advisories/GHSA-cp4w-6x4w-v2h5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-28628"
}, {
"type" : "WEB",
"url" : "https://github.com/lambdaisland/uri/commit/f46db3e84846f79e14bfee0101d9c7a872321820"
}, {
"type" : "WEB",
"url" : "https://github.com/google/closure-library/blob/0e567abedb058e9b194a40cfa3ad4c507653bccf/closure/goog/uri/utils.js#L189"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/lambdaisland/uri"
}, {
"type" : "WEB",
"url" : "https://github.com/lambdaisland/uri/blob/d3355fcd3e235238f4dcd37be97787a84e580072/src/lambdaisland/uri.cljc#L9"
}, {
"type" : "WEB",
"url" : "https://github.com/lambdaisland/uri/releases/tag/v1.14.120"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601", "CWE-706" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-03-27T22:31:13Z",
"nvd_published_at" : "2023-03-27T21:15:00Z"
}
}