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
IsPasswordMatchimplementation.
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
IsPasswordMatchfunction 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, orLoginHandlerthat 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.

