NULL Pointer Dereference Affecting github.com/lestrrat-go/jwx/v2/jws package, versions <2.0.19


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.13% (34th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about NULL Pointer Dereference vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMLESTRRATGOJWXV2JWS-6149443
  • published10 Jan 2024
  • disclosed9 Jan 2024
  • creditfrestr

Introduced: 9 Jan 2024

CVE-2024-21664  (opens in a new tab)
CWE-476  (opens in a new tab)

How to fix?

Upgrade github.com/lestrrat-go/jwx/v2/jws to version 2.0.19 or higher.

Overview

Affected versions of this package are vulnerable to NULL Pointer Dereference via the jws.Parse function when a JSON serialized payload contains a signature field without a corresponding protected field. An attacker can cause a denial of service for a system doing JWS verification by sending a crafted payload that triggers a nil pointer dereference.

PoC

package poc

import (
        "testing"

        "github.com/lestrrat-go/jwx/v2/jws"
)

func TestPOC(t *testing.T) {
        _, _ = jws.Parse([]byte(`{"signature": ""}`))
}

CVSS Base Scores

version 3.1