@waline/vercel: Improper Authentication (ghsa:GHSA-jf75-q64q-g65r)
Veröffentlicht Quellen: Hersteller
Was ist betroffen, was ist zu tun
Aktualisieren Sie @waline/vercel auf Version 1.41.0.
Unklar, ob und wie Sie betroffen sind? Frage zu dieser Schwachstelle stellen
Metriken
—
Priorität
Für diese Schwachstelle liegt kein Wert vor.
—
CVSS v3
Für diese Schwachstelle liegt kein Wert vor.
—
EPSS-Score
Für diese Schwachstelle liegt kein Wert vor.
Alle Metriken anzeigen
- Schweregrad
- Mittel
Priorität (0–325)
Der Priorisierungs-Score ist eine zusammengeführte Kennzahl, die mehrere Einzelsignale zu einer einzigen, handlungsleitenden Rangfolge verdichtet: technische Schwere (CVSS), Ausnutzungswahrscheinlichkeit (EPSS), der Status als bekannt ausgenutzt (KEV) und der Kontext des betroffenen Assets. Ziel ist die Antwort auf die einzig wirklich wichtige Frage im Schwachstellenmanagement: Was zuerst?
Im Glossar lesen- 30.00 Methodik
Exploit-Reife
Ein Exploit ist Code oder eine Technik, die eine konkrete Schwachstelle gezielt ausnutzt, um ein unbeabsichtigtes Verhalten zu erzwingen — etwa Code auszuführen oder Rechte auszuweiten. Er ist das Werkzeug, das aus einer theoretischen Lücke einen praktischen Angriff macht.
Im Glossar lesen- kein öffentlicher PoC bekannt
KEV-Status
Der KEV-Katalog ist eine von der US-Behörde CISA gepflegte Liste von Schwachstellen, für die eine aktive Ausnutzung in der Praxis nachgewiesen ist. Er beantwortet nicht die Frage „wie schwer?“, sondern „wird es bereits angegriffen?“ — und priorisiert damit das Patchen scharf.
Im Glossar lesen- —
- Veröffentlicht
CWE
CWE ist ein Katalog typischer Schwächen-Arten in Software und Hardware — etwa fehlerhafte Eingabevalidierung, unsichere Speicherbehandlung oder mangelhafte Authentisierung. Während eine CVE eine konkrete Schwachstelle in einem konkreten Produkt benennt, beschreibt eine CWE die zugrunde liegende Fehlerklasse.
Im Glossar lesen- CWE-287, CWE-943
Einordnung nach NIS2 und CRA
Regelbasierte Einordnung aus Ausnutzungsstatus und Schweregrad. Sie ersetzt keine Prüfung im Einzelfall.
NIS2
NIS2 ist die EU-Richtlinie (EU) 2022/2555 zur Erhöhung des Cybersicherheitsniveaus in der Union. Sie weitet Pflichten gegenüber der ersten NIS-Richtlinie deutlich aus: mehr Sektoren, verbindliches Risikomanagement, gestufte Meldepflichten und persönliche Verantwortung der Geschäftsleitung.
Im Glossar lesen- Behandeln Sie die Schwachstelle im regulären Schwachstellenmanagement nach Art. 21 Abs. 2 lit. e NIS2.
CRA
Der CRA ist die EU-Verordnung (EU) 2024/2847 mit horizontalen Cybersicherheitsanforderungen an „Produkte mit digitalen Elementen“ — von Industriesteuerungen über Software bis zu vernetzten Verbrauchergeräten. Erstmals müssen Hersteller Sicherheit über den gesamten Produktlebenszyklus gewährleisten, Schwachstellen behandeln und Sicherheitsupdates bereitstellen.
Im Glossar lesen- Ab dem 11.12.2027 verpflichtet Anhang I Teil II CRA Hersteller betroffener Produkte mit digitalen Elementen, Schwachstellen unverzüglich zu behandeln und Sicherheitsupdates bereitzustellen.
ISO/IEC 27001
ISO/IEC 27001 ist der international führende Standard für ein Informationssicherheits-Managementsystem (ISMS). Er beschreibt einen risikobasierten, prozessorientierten Rahmen, um Informationssicherheit systematisch zu planen, umzusetzen, zu überprüfen und zu verbessern.
Im Glossar lesen- Maßnahme A.8.8, Management technischer Schwachstellen: Relevanz für Ihre Systeme bewerten, Behebung einplanen und nachweisen.
Beschreibung
Summary
The login endpoint POST /api/token reads the email field from the request body without checking its type and passes it straight into the MongoDB storage query. When email is not a string (for example a JSON object such as {"$ne": null}), the MongoDB storage adapter's parseWhere silently DROPS the field rather than rejecting the request, producing an empty filter that matches ALL users. The endpoint then verifies the submitted password against the FIRST user returned (user[0]), which in Waline is the first-registered user — the site administrator.
This is a PARTIAL authentication bypass, not a full one. The attacker still needs a valid password for that first user; this is not a zero-knowledge bypass and it does not disclose passwords. Its concrete effects are: (1) the email/identifier factor is removed for the administrator account, (2) user enumeration (a non-string email never fails the "no such user" branch), and (3) credential-stuffing amplification — an attacker can test a leaked or weak password against the administrator account without knowing the administrator's email.
Details
Untyped input — packages/server/src/controller/token.js:17-18:
const { email, password, code } = this.post();
const user = await this.modelInstance.select({ email });
email comes from the request body with no type check.
The storage adapter silently drops a non-string key — packages/server/src/service/storage/mongodb.js, parseWhere():
if (think.isString(where[k])) { filter[parseKey(k)] = { $eq: ... }; continue; } // intended guard
if (where[k] === undefined) { ... }
if (Array.isArray(where[k]) && where[k][0]) { ... operator handling (IN/LIKE/!=/> ...) }
A plain object such as {"$ne": null} is neither a string, undefined, nor an array, so NONE of the branches run and nothing is added to filter for email. The result is filter = {} -> instance.where({}) -> MongoDB find({}) returns every user. (The array form, e.g. ["!=", ""], is a genuine operator injection that reaches $ne with the same match-all effect.)
First user is selected — token.js:22-26:
if (think.isEmpty(user) || isVerifyUser || isBannedUser) { return this.fail(); } // match-all -> not empty -> passes
const checkPassword = this.checkPassword(password, user[0].password);
user[0] is the first record in MongoDB natural (insertion) order, i.e. the earliest-registered user, which in Waline is the administrator.
No upstream type validation — packages/server/src/logic/token.js:37-38:
async postAction() { await this.useCaptchaCheck(); }
The only pre-check is the captcha; there is no isString(email/password) validation.
Proof of Concept
Send a login request whose email is a non-string value:
POST /api/token HTTP/1.1
Content-Type: application/json
{"email": {"$ne": null}, "password": "<password-to-test>"}
- Because
emailis not a string, parseWhere adds nothing for it, so the query filter is {} and MongoDB returns all users. - user[0] — the first-registered user, i.e. the administrator — is selected, and the submitted password is checked against the administrator's hash.
- If the password matches (for example via credential stuffing or a known/weak password), the attacker is authenticated as the administrator without ever knowing the administrator's email.
- Even when the password does not match, the request confirms that users exist (enumeration) and that the email factor is bypassable.
Impact
An unauthenticated attacker can bypass the email/identifier factor of authentication for the first-registered user (the administrator) and have an arbitrary password checked directly against that account. This:
- enables user enumeration;
- amplifies credential stuffing against the administrator (no need to know the admin email — a leaked or weak password can be tested directly);
- and, when the attacker possesses a valid password for that account (e.g. a reused/breached one), results in administrator login.
This is bounded: it is NOT a zero-knowledge authentication bypass, it does NOT reveal passwords, and it targets the first-returned user rather than an arbitrary chosen account. It is rated Medium accordingly. (If exploitation succeeds in logging in, the attacker then holds the administrator session; that downstream impact is conditional on already having a valid password, which is reflected in the High attack complexity rather than in the confidentiality/integrity metrics.)
Remediation
Validate the types of email and password as strings before they reach the storage query — for example in packages/server/src/logic/token.js postAction():
const { email, password } = this.post();
if (!think.isString(email) || !think.isString(password)) {
return this.ctx.throw(400, 'Invalid input type');
}
Defense in depth: in mongodb.js parseWhere(), reject (rather than silently drop) a value that is neither a string nor a supported array form, or coerce it to {$eq: String(value)}, so a non-string key can never elide the filter.
Quelle: GitHub Security Advisories
Betroffene Produkte
Betroffen sind die folgenden Versionen. Ältere Stände derselben Reihe sind ebenfalls verwundbar, sofern nicht anders angegeben.
| Betroffene Versionen | Behoben in | ||
|---|---|---|---|
| npm | @waline/vercel |
|
|
Weakness-Klassen (CWE)
CWE-287Improper Authentication
Class
When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.
Eintrag bei MITRE CWE-287CWE-943Improper Neutralization of Special Elements in Data Query Logic
Class
The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.
Eintrag bei MITRE CWE-943