CVE-2026-38651: Netmaker Vulnerability in JWT Signature Verification
Summary
CVE-2026-38651: Netmaker does not verify JWT signatures for host tokens. Affects github.com/gravitl/netmaker versions < 1.5.0. Fixed in 1.5.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Netmaker is an open-source networking platform developed by Gravitl, designed for creating and managing virtual overlay networks using WireGuard technology. It allows users to easily set up secure connections between devices over the internet. The platform's functionality includes managing host configurations, facilitating secure communications, and providing a user-friendly interface for network management. However, a critical vulnerability has been identified in its JWT (JSON Web Token) handling, which could expose sensitive information.
Vulnerability Detail
The vulnerability arises from the VerifyHostToken function in the logic/jwts.go file of the Netmaker package. This function fails to validate the JWT signature when verifying host tokens. Specifically, after calling jwt.ParseWithClaims, the function only checks if the returned token object is non-nil, neglecting to verify token.Valid or handle any returned errors. This oversight allows an attacker to forge a JWT signed with any key, manipulate the claims to impersonate any host ID, and gain unauthorized access to sensitive configurations, including bcrypt-hashed passwords, MQTT credentials, and WireGuard peer data. The implications of this vulnerability are severe, as it could lead to unauthorized access and potential data breaches.
How To Fix
Latest published version: v1.7.0 as of 23 Oct 2026
go get github.com/gravitl/netmaker@v1.7.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.5.0
This is the first release that contains the fix.
go get github.com/gravitl/netmaker@v1.5.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can implement additional checks in your application to validate JWT signatures before processing host tokens. However, this is not a substitute for updating to the patched version. Here is a basic example of how you might implement a signature check:
import (
"github.com/dgrijalva/jwt-go"
"log"
)
func VerifyToken(tokenString string, secretKey []byte) bool {
token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
// Ensure the token's signing method is what you expect
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
}
return secretKey, nil
})
if err != nil || !token.Valid {
log.Println("Invalid token")
return false
}
return true
}
This code snippet checks the token's validity and ensures the signing method is as expected.
Conclusion
In summary, the vulnerability identified as CVE-2026-38651 in the Netmaker package poses a significant risk due to improper JWT signature verification. It is crucial for users to update to version 1.5.0 or later to mitigate this risk. Additionally, implementing temporary workarounds can provide some level of protection until the update is applied.
See every vulnerability recorded for github.com/gravitl/netmaker →
FAQ
The vulnerability allows attackers to forge JWT tokens and gain unauthorized access to sensitive configurations in Netmaker.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which monitors open-source vulnerabilities without requiring installation.
If exploited, this vulnerability could lead to unauthorized access to sensitive data, including passwords and configuration details.
Yes, the vulnerability has been patched in version 1.5.0 of the Netmaker package. It is recommended to update to this version.
The CVSS score of this vulnerability is 8.2, indicating a critical level of severity.
Related vulnerabilities
Recent vulnerabilities recorded for github.com/gravitl/netmaker.