Skip to content

Note Mark has a JWT Secret Weakness that allows Full Account Takeover via Token Forgery

Critical severity GitHub Reviewed Published May 2, 2026 in enchant97/note-mark • Updated May 15, 2026

Package

gomod github.com/enchant97/note-mark/backend (Go)

Affected versions

< 0.0.0-20260501152247-18b587758667

Patched versions

0.0.0-20260501152247-18b587758667

Description

Summary

No minimum length or entropy is enforced on the JWT_SECRET configuration value. The application accepts any base64-decodable secret regardless of size, including secrets as short as 1 byte.

HS256 secrets below 32 bytes are brute-forceable offline, allowing attackers to recover the signing key and forge valid JWTs for arbitrary users.


Impact

An attacker who captures a single valid JWT (e.g, from cookies, logs, or network traffic) can:

> Crack the signing secret offline using brute-force or wordlist attacks
> Forge valid JWTs for any user ID (including administrators)
> Authenticate without knowing any credentials

This results in full account takeover across the entire application with no server-side detection or rate limiting possible.


Details

In backend/config/utils.go, the Base64Decoded.UnmarshalText function decodes the JWT secret but does not validate its length or entropy.

In backend/core/auth.go, JWT tokens are signed using HS256 without enforcing minimum key size requirements.

According to RFC 7518 Section 3.2, HS256 keys must be at least 256 bits (32 bytes). Libraries such as PyJWT explicitly warn against shorter keys, but note-mark performs no such validation.


PoC

1- Deploy note-mark with a weak secret:

JWT_SECRET = base64("testsecret123456789012345")

2- Register an account and capture the Auth-Session-Token cookie

3- Crack the secret offline (example using Python):

import jwt, base64
jwt.decode(TOKEN, base64.b64decode(SECRET), algorithms=["HS256"])

4- Forge a new token for any user UUID with extended expiry

5- Send the forged token in requests → server returns 200 Ok and authenticates as that user


Reproduction Steps

1- Deploy the application with a JWT secret shorter than 32 bytes (after base64 decoding)
2- Authenticate and capture a valid JWT
3- Perform offline brute-force or dictionary attack against the token signature
4- Recover the secret
5- Generate a forged JWT for another user
6- Use the forged token to access protected endpoints


Fix Recommendation

  • Enforce a minimum of 32 bytes (256 bits) for JWT secrets after base64 decoding
  • Reject weak secrets during configuration parsing (e.g., in Base64Decoded.UnmarshalText or config validation)
  • Optionally log warnings or fail startup if the secret is insecure

Resources

  • RFC 7518 Section 3.2 (JSON Web Algorithms - HMAC key size requirements)
  • CWE-326: Inadequate Encryption Strength
  • CWE-345: Insufficient Verification of Data Authenticity

References

@enchant97 enchant97 published to enchant97/note-mark May 2, 2026
Published to the GitHub Advisory Database May 7, 2026
Reviewed May 7, 2026
Published by the National Vulnerability Database May 14, 2026
Last updated May 15, 2026

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(3rd percentile)

Weaknesses

Inadequate Encryption Strength

The product stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required. Learn more on MITRE.

Insufficient Verification of Data Authenticity

The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. Learn more on MITRE.

CVE ID

CVE-2026-44523

GHSA ID

GHSA-q6mh-rqwh-g786

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.