/

CVE-2026-41571

Severity:

CRITICAL RISK

(9.4)

Authentication Bypass in Note Mark

CVE-2026-41571

Deferred

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Account Takeover / Unauthorized Access

Severity:

CRITICAL RISK

(9.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Note Mark 0.19.2 contains an authentication logic flaw where accounts without a stored password are implicitly associated with a hard-coded bcrypt hash of the string "null".

For OIDC-registered users created with an empty password, submitting the literal password "null" to the internal login endpoint yields a valid session for that user, enabling full account takeover without prior access or user interaction.

Affected context

This vulnerability occurs in Note Mark deployments using version 0.19.2 where:

  • The application supports both OIDC-based registration and local password-based login.
  • OIDC-registered users are created with an empty password field in the database.
  • The backend login endpoint is reachable (e.g., via a web UI or API) and uses the vulnerable IsPasswordMatch implementation.

Under these conditions, accounts that were meant to be authenticated only via OIDC may be silently treated as if they shared a common fallback password.

Exploit preconditions

  • Attack surface: Application login endpoint exposed over HTTP(S).
  • Required access: None; the bypass is unauthenticated and does not require prior credentials.
  • Trigger point: Submitting a login request for a target username or identifier with the password set to the exact string "null".
  • Why exploitation is possible: When a user record has no stored password, the IsPasswordMatch function compares the submitted password against a hard-coded bcrypt hash for "null", effectively granting access to any such account using that shared password.

Why this happens

The core issue is an authentication logic flaw where missing credential data is handled by falling back to a hard-coded placeholder hash instead of treating the account as passwordless or rejecting password-based login.

In abstract terms, this maps to CWE-287: Improper Authentication:

  • Authentication decisions are based on an implementation convenience (a default bcrypt("null") value) rather than a strong, per-user secret.
  • Accounts that should rely solely on federated/OIDC authentication are inadvertently given a shared, guessable password.
  • The logic fails to distinguish between "no password set" and "user has a valid password," enabling a trivial bypass of the intended identity verification mechanism.

Potential impact

  • Complete takeover of any OIDC-registered user account by logging in with the password "null".
  • Unauthorized access to all notes, attachments, and personal data owned by affected users.
  • Ability to modify, delete, or exfiltrate stored notes and associated metadata.
  • Potential lateral movement if Note Mark accounts are used to store credentials, API keys, or sensitive configuration data.
  • Reputational damage and possible regulatory exposure if user data is compromised at scale.

General mitigation guidance

Effective mitigation focuses on ensuring authentication decisions are strictly bound to valid, per-user secrets and explicit authentication flows:

  • Treat accounts with no password set as ineligible for password-based login; reject any password attempts and require OIDC or other configured identity providers.
  • Avoid any hard-coded or shared fallback password values, bcrypt hashes, or default credentials at the authentication layer.
  • Model authentication state explicitly: track which identity mechanisms are enabled per account (e.g., OIDC-only vs. local password) and enforce that policy at login time.
  • Normalize and validate credential fields so that "empty", "null", or placeholder values cannot be misinterpreted as valid credentials.
  • Apply least-privilege design to session management: ensure session creation is strictly gated on successful, policy-compliant authentication and not on partial matches or convenience paths.

How teams detect issues like this

Detection can rely on both code-centric and behavior-centric approaches:

  • Static analysis / code scanning:
  • Flag use of hard-coded bcrypt hashes, default passwords, or "null" placeholders in authentication-related code.
  • Identify logic that treats missing password fields as a special case instead of failing authentication.
  • Search for authentication helpers that do not verify the presence of a real per-user secret before allowing login.
  • Code review signals:
  • Pay special attention to branching logic in functions like IsPasswordMatch, Authenticate, or LoginHandler that handle empty or nil credential fields.
  • Question any use of shared constants or magic values in password checking logic.
  • Runtime and logging analysis:
  • Monitor for unusual patterns such as repeated successful logins using the same simple password (e.g., "null") across many accounts.
  • Enable login attempt logging (with appropriate privacy controls) and alert on anomalous spikes in authentications for OIDC-only users via password-based endpoints.
  • Security testing:
  • Incorporate negative test cases for accounts with no password set, verifying that password-based login is rejected when only federated auth should be allowed.

Sources

SourceLink
github.comgithub.com/enchant97/note-mark/releases/tag/v0.19.3
github.comgithub.com/enchant97/note-mark/security/advisories/GHSA-pxf8-6wqm-r6hh

Frequently asked

questions

The vulnerability is broadly exploitable wherever the affected Note Mark version is deployed and the login endpoint is reachable. Any attacker who knows or can guess valid usernames for OIDC-registered users can obtain their sessions by submitting the password "null".

No prior account or access is required. The bypass is fully unauthenticated; the attacker only needs a valid username or identifier for a target OIDC-based account and network access to the login endpoint.

The safest pattern is to treat accounts with no password as password-ineligible: remove any fallback hash logic, ensure that password comparison only occurs when a real per-user hash exists, and restrict OIDC-linked accounts to federated login only unless a secure, explicit password setup process is completed.

Prevent them by designing authentication flows with explicit states (e.g., "password-enabled" vs. "OIDC-only"), avoiding any hard-coded or shared secrets, mandating security-focused code review for auth-related changes, and incorporating tests that verify correct behavior for accounts with empty or unset credentials.

Find out what's already
exploitable in your codebase.