CVE-2025-4143: @cloudflare/workers oauth provider @cloudflare/workers-oauth-provider Missing Validation Of Redirect_uri Vulnerability

MODERATE
Advisory Identifier: GHSA-4pc9-x2fx-p7vj
CWE-601
Published
Advisory Summary

CVE-2025-4143 is a MODERATE @cloudflare/workers-oauth-provider missing validation of redirect_uri vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting @cloudflare/workers oauth provider libraries in the npm ecosystem. The issue involves @cloudflare/workers-oauth-provider missing validation of redirect_uri on authorize endpoint. Remediation is available by upgrading affected packages to version 0.0.5.

CVE-2025-4143 at a Glance

CVE Identifier CVE-2025-4143
GHSA Identifier GHSA-4pc9-x2fx-p7vj
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product @cloudflare/workers oauth provider
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-4143

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

@cloudflare/workers-oauth-provider fixed: 0.0.5
npm install @cloudflare/workers-oauth-provider@0.0.5
Verify Direct and Transitive Dependencies

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

npm ls @cloudflare/workers-oauth-provider

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-4143, inspect your project dependencies using npm:

npm ls @cloudflare/workers-oauth-provider

Analyze the terminal output to locate any version of @cloudflare/workers oauth provider in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.5), your application is affected.

Note: The npm ls @cloudflare/workers-oauth-provider command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In @cloudflare/workers oauth provider, 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

### Summary The OAuth implementation failed to check that redirect_uri was among the allowed set for the client_id. ### Impact Under certain circumstances (see below), if a victim had previously authorized with a server built on workers-oath-provider, and an attacker could later trick the victim into visiting a malicious web site, then attacker could potentially steal the victim's credentials to the same OAuth server and subsequently impersonate them. In order for the attack to be possible, the OAuth server's authorized callback must be designed to auto-approve authorizations that appear to come from an OAuth client that the victim has authorized previously. The authorization flow is not implemented by workers-oauth-provider; it is up to the application built on top to decide whether to implement such automatic re-authorization. However, many applications do implement such logic. ### Patches Fixed in: https://github.com/cloudflare/workers-oauth-provider/pull/26 We patched up the vulnerabilities in the latest version, v 0.0.5 of the Workers OAuth provider (https://www.npmjs.com/package/@cloudflare/workers-oauth-provider). You'll need to update your MCP servers to use that version to resolve the vulnerability. ### Workarounds None ### Note It is a basic, well-known requirement that OAuth servers should verify that the redirect URI is among the allowed list for the client, both during the authorization flow and subsequently when exchanging the authorization code for an access token. workers-oauth-provider implemented only the latter check, not the former. Unfortunately, the former is the much more important check. Readers who are familiar with OAuth may recognize that failing to check redirect URIs against the allowed list is a well-known, basic mistake, covered extensively in the RFC and elsewhere. The author of this library would like everyone to know that he was, in fact, well-aware of this requirement, thought about it a lot while designing the library, and then, somehow, forgot to actually make sure the check was in the code. That is, it's not that he didn't know what he was doing, it's that he knew what he was doing but flubbed it.

CVE-2025-4143 Affected @cloudflare/workers oauth provider Versions

1 component(s)
Fixed Versions:
0.0.5
Product / Package Ecosystem Affected Versions Fixed Version
@cloudflare/workers-oauth-provider
npm
< 0.0.5
0.0.5

References

Frequently Asked Questions

What is CVE-2025-4143?
CVE-2025-4143 is a security vulnerability in @cloudflare/workers oauth provider involving @cloudflare/workers-oauth-provider missing validation of redirect_uri on authorize endpoint under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which @cloudflare/workers oauth provider versions are affected?
Affected versions include releases prior to 0.0.5 across affected packages: @cloudflare/workers-oauth-provider.
What version fixes CVE-2025-4143?
Upgrading to 0.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @cloudflare/workers-oauth-provider affected?
Yes, @cloudflare/workers-oauth-provider is affected in releases prior to 0.0.5. Upgrade your dependency to 0.0.5 or later.
What CWE is associated with CVE-2025-4143?
CVE-2025-4143 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for CVE-2025-4143?
Run the dependency tree command: 'npm ls @cloudflare/workers-oauth-provider'. 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-4pc9-x2fx-p7vj",
  "modified" : "2025-07-28T20:26:33Z",
  "published" : "2025-05-01T17:00:29Z",
  "aliases" : [ "CVE-2025-4143" ],
  "summary" : "@cloudflare/workers-oauth-provider missing validation of redirect_uri on authorize endpoint",
  "details" : "### Summary\nThe OAuth implementation failed to check that redirect_uri was among the allowed set for the client_id.\n\n### Impact\nUnder certain circumstances (see below), if a victim had previously authorized with a server built on workers-oath-provider, and an attacker could later trick the victim into visiting a malicious web site, then attacker could potentially steal the victim's credentials to the same OAuth server and subsequently impersonate them.\n\nIn order for the attack to be possible, the OAuth server's authorized callback must be designed to auto-approve authorizations that appear to come from an OAuth client that the victim has authorized previously. The authorization flow is not implemented by workers-oauth-provider; it is up to the application built on top to decide whether to implement such automatic re-authorization. However, many applications do implement such logic.\n\n\n### Patches\nFixed in: https://github.com/cloudflare/workers-oauth-provider/pull/26\n\nWe patched up the vulnerabilities in the latest version, v 0.0.5 of the Workers OAuth provider (https://www.npmjs.com/package/@cloudflare/workers-oauth-provider). You'll need to update your MCP servers to use that version to resolve the vulnerability.\n\n\n### Workarounds\nNone\n\n### Note\n\nIt is a basic, well-known requirement that OAuth servers should verify that the redirect URI is among the allowed list for the client, both during the authorization flow and subsequently when exchanging the authorization code for an access token. workers-oauth-provider implemented only the latter check, not the former. Unfortunately, the former is the much more important check.\n\nReaders who are familiar with OAuth may recognize that failing to check redirect URIs against the allowed list is a well-known, basic mistake, covered extensively in the RFC and elsewhere. The author of this library would like everyone to know that he was, in fact, well-aware of this requirement, thought about it a lot while designing the library, and then, somehow, forgot to actually make sure the check was in the code. That is, it's not that he didn't know what he was doing, it's that he knew what he was doing but flubbed it.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:L/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@cloudflare/workers-oauth-provider"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/workers-oauth-provider/security/advisories/GHSA-4pc9-x2fx-p7vj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-4143"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cloudflare/workers-oauth-provider/pull/26"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cloudflare/workers-oauth-provider"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-01T17:00:29Z",
    "nvd_published_at" : null
  }
}