VYPR
Moderate severityNVD Advisory· Published Jul 21, 2023· Updated Oct 10, 2024

API token authentication bypass in HTTP endpoints in Dapr

CVE-2023-37918

Description

Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge. 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 or to 1.11.2. 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. The issue has been fixed in Dapr 1.10.9 or to 1.11.2. There are no known workarounds for this vulnerability.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/dapr/daprGo
>= 1.11.0, < 1.11.21.11.2
github.com/dapr/daprGo
< 1.10.91.10.9

Affected products

1

Patches

2
99d6799c97b7

Fixed API token authentication bypassed when path contains `/healthz`

https://github.com/dapr/daprItalyPaleAleJul 19, 2023via ghsa
4 files changed · +43 32
  • docs/release_notes/v1.10.9.md+22 1 modified
    @@ -2,7 +2,28 @@
     
     This update contains security fixes:
     
    -  - [Security: Potential DoS in avro dependency (CVE-2023-37475)](#security-potential-dos-in-avro-dependency-cve-2023-37475)
    +  - [Security: API token authentication bypass in HTTP endpoints](#security-api-token-authentication-bypass-in-http-endpoints) ([Security advisory](https://github.com/dapr/dapr/security/advisories/GHSA-59m6-82qm-vqgj))
    +  - [Security: Potential DoS in avro dependency](#security-potential-dos-in-avro-dependency-cve-2023-37475) ([CVE-2023-37475](https://github.com/hamba/avro/security/advisories/GHSA-9x44-9pgq-cf45))
    +
    +## Security: API token authentication bypass in HTTP endpoints
    +
    +### Problem
    +
    +[Security advisory](https://github.com/dapr/dapr/security/advisories/GHSA-59m6-82qm-vqgj)
    +
    +A high-severity 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.
    +
    +### Impact
    +
    +The vulnerability impacts all users on Dapr <=1.10.9 and <=1.11.2 who are using API token authentication.
    +
    +### Root cause
    +
    +The Dapr sidecar allowed all requests containing `/healthz` in the URL (including query string) to bypass API token authentication.
    +
    +### Solution
    +
    +We have changed the API token authentication middleware to allow bypassing the authentication only for healthcheck endpoints more strictly.
     
     ## Security: Potential DoS in avro dependency (CVE-2023-37475)
     
    
  • pkg/http/server.go+21 4 modified
    @@ -287,12 +287,29 @@ func useAPIAuthentication(next fasthttp.RequestHandler) fasthttp.RequestHandler
     
     	return func(ctx *fasthttp.RequestCtx) {
     		v := ctx.Request.Header.Peek(authConsts.APITokenHeader)
    -		if auth.ExcludedRoute(string(ctx.Request.URI().FullURI())) || string(v) == token {
    -			ctx.Request.Header.Del(authConsts.APITokenHeader)
    -			next(ctx)
    -		} else {
    +		if string(v) != token && !isRouteExcludedFromAPITokenAuth(string(ctx.Request.Header.Method()), string(ctx.Request.URI().FullURI())) {
     			ctx.Error("invalid api token", http.StatusUnauthorized)
    +			return
     		}
    +
    +		ctx.Request.Header.Del(authConsts.APITokenHeader)
    +		next(ctx)
    +	}
    +}
    +
    +func isRouteExcludedFromAPITokenAuth(method string, urlString string) bool {
    +	u, err := url.Parse(urlString)
    +	if err != nil {
    +		return false
    +	}
    +	path := strings.Trim(u.Path, "/")
    +	switch path {
    +	case apiVersionV1 + "/healthz":
    +		return method == http.MethodGet
    +	case apiVersionV1 + "/healthz/outbound":
    +		return method == http.MethodGet
    +	default:
    +		return false
     	}
     }
     
    
  • pkg/runtime/security/token.go+0 13 modified
    @@ -15,13 +15,10 @@ package security
     
     import (
     	"os"
    -	"strings"
     
     	"github.com/dapr/dapr/pkg/runtime/security/consts"
     )
     
    -var excludedRoutes = []string{"/healthz"}
    -
     // GetAPIToken returns the value of the api token from an environment variable.
     func GetAPIToken() string {
     	return os.Getenv(consts.APITokenEnvVar)
    @@ -31,13 +28,3 @@ func GetAPIToken() string {
     func GetAppToken() string {
     	return os.Getenv(consts.AppAPITokenEnvVar)
     }
    -
    -// ExcludedRoute returns whether a given route should be excluded from a token check.
    -func ExcludedRoute(route string) bool {
    -	for _, r := range excludedRoutes {
    -		if strings.Contains(route, r) {
    -			return true
    -		}
    -	}
    -	return false
    -}
    
  • pkg/runtime/security/token_test.go+0 14 modified
    @@ -54,17 +54,3 @@ func TestAppToken(t *testing.T) {
     		assert.Equal(t, "", token)
     	})
     }
    -
    -func TestExcludedRoute(t *testing.T) {
    -	t.Run("healthz route is excluded", func(t *testing.T) {
    -		route := "v1.0/healthz"
    -		excluded := ExcludedRoute(route)
    -		assert.True(t, excluded)
    -	})
    -
    -	t.Run("custom route is not excluded", func(t *testing.T) {
    -		route := "v1.0/state"
    -		excluded := ExcludedRoute(route)
    -		assert.False(t, excluded)
    -	})
    -}
    
83ca1abb11ff

Fixed API token authentication bypassed when path contains `/healthz`

https://github.com/dapr/daprItalyPaleAleJul 19, 2023via ghsa
4 files changed · +43 32
  • docs/release_notes/v1.11.2.md+22 1 modified
    @@ -2,14 +2,35 @@
     
     This update contains security fixes:
     
    -  - [Security: Potential DoS in avro dependency (CVE-2023-37475)](#security-potential-dos-in-avro-dependency-cve-2023-37475)
    +  - [Security: API token authentication bypass in HTTP endpoints](#security-api-token-authentication-bypass-in-http-endpoints) ([Security advisory](https://github.com/dapr/dapr/security/advisories/GHSA-59m6-82qm-vqgj))
    +  - [Security: Potential DoS in avro dependency](#security-potential-dos-in-avro-dependency-cve-2023-37475) ([CVE-2023-37475](https://github.com/hamba/avro/security/advisories/GHSA-9x44-9pgq-cf45))
     
     Additionally, this patch release contains bug fixes:
     
       - [Fixed: unbounded history batch save in Workflows](#fixed-unbounded-history-batch-save-in-workflows)
       - [Fixed: Workflows not working in some Kubernetes clusters](#fixed-workflows-not-working-in-some-kubernetes-clusters)
       - [Fixed a number of bugs in the gRPC Configuration Subscribe API](#fixed-a-number-of-bugs-in-the-grpc-configuration-subscribe-api)
     
    +## Security: API token authentication bypass in HTTP endpoints
    +
    +### Problem
    +
    +[Security advisory](https://github.com/dapr/dapr/security/advisories/GHSA-59m6-82qm-vqgj)
    +
    +A high-severity 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.
    +
    +### Impact
    +
    +The vulnerability impacts all users on Dapr <=1.10.9 and <=1.11.2 who are using API token authentication.
    +
    +### Root cause
    +
    +The Dapr sidecar allowed all requests containing `/healthz` in the URL (including query string) to bypass API token authentication.
    +
    +### Solution
    +
    +We have changed the API token authentication middleware to allow bypassing the authentication only for healthcheck endpoints more strictly.
    +
     ## Security: Potential DoS in avro dependency (CVE-2023-37475)
     
     ### Problem
    
  • pkg/http/server.go+21 4 modified
    @@ -287,12 +287,29 @@ func useAPIAuthentication(next fasthttp.RequestHandler) fasthttp.RequestHandler
     
     	return func(ctx *fasthttp.RequestCtx) {
     		v := ctx.Request.Header.Peek(authConsts.APITokenHeader)
    -		if auth.ExcludedRoute(string(ctx.Request.URI().FullURI())) || string(v) == token {
    -			ctx.Request.Header.Del(authConsts.APITokenHeader)
    -			next(ctx)
    -		} else {
    +		if string(v) != token && !isRouteExcludedFromAPITokenAuth(string(ctx.Request.Header.Method()), string(ctx.Request.URI().FullURI())) {
     			ctx.Error("invalid api token", http.StatusUnauthorized)
    +			return
     		}
    +
    +		ctx.Request.Header.Del(authConsts.APITokenHeader)
    +		next(ctx)
    +	}
    +}
    +
    +func isRouteExcludedFromAPITokenAuth(method string, urlString string) bool {
    +	u, err := url.Parse(urlString)
    +	if err != nil {
    +		return false
    +	}
    +	path := strings.Trim(u.Path, "/")
    +	switch path {
    +	case apiVersionV1 + "/healthz":
    +		return method == http.MethodGet
    +	case apiVersionV1 + "/healthz/outbound":
    +		return method == http.MethodGet
    +	default:
    +		return false
     	}
     }
     
    
  • pkg/runtime/security/token.go+0 13 modified
    @@ -15,13 +15,10 @@ package security
     
     import (
     	"os"
    -	"strings"
     
     	"github.com/dapr/dapr/pkg/runtime/security/consts"
     )
     
    -var excludedRoutes = []string{"/healthz"}
    -
     // GetAPIToken returns the value of the api token from an environment variable.
     func GetAPIToken() string {
     	return os.Getenv(consts.APITokenEnvVar)
    @@ -31,13 +28,3 @@ func GetAPIToken() string {
     func GetAppToken() string {
     	return os.Getenv(consts.AppAPITokenEnvVar)
     }
    -
    -// ExcludedRoute returns whether a given route should be excluded from a token check.
    -func ExcludedRoute(route string) bool {
    -	for _, r := range excludedRoutes {
    -		if strings.Contains(route, r) {
    -			return true
    -		}
    -	}
    -	return false
    -}
    
  • pkg/runtime/security/token_test.go+0 14 modified
    @@ -54,17 +54,3 @@ func TestAppToken(t *testing.T) {
     		assert.Equal(t, "", token)
     	})
     }
    -
    -func TestExcludedRoute(t *testing.T) {
    -	t.Run("healthz route is excluded", func(t *testing.T) {
    -		route := "v1.0/healthz"
    -		excluded := ExcludedRoute(route)
    -		assert.True(t, excluded)
    -	})
    -
    -	t.Run("custom route is not excluded", func(t *testing.T) {
    -		route := "v1.0/state"
    -		excluded := ExcludedRoute(route)
    -		assert.False(t, excluded)
    -	})
    -}
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.