Pentest 2026-05-20 Pen-28-Befunde (LOW/INFO)
28.1 URI-Schema unvollstaendig: DANGEROUS_URI_SCHEMES erweitert um file:/ftp: – "ftp://evil.com/x.js" und "file:///etc/passwd" wurden vorher in companyName akzeptiert. 28.2 HTML-Entity-Decoding-Bypass: stripHtml() lief direkt ueber den Roh-String, "javascript:", "<script>" und "<script>" umgingen die Regex. decodeHtmlEntities() dekodiert jetzt numerische (decimal+hex) + gaengige named entities VOR dem Tag-/URI-Strip. 28.3 Vollmacht-Upload Magic-Byte-Check: multer pruefte nur client-MIME, HTML/PHP/Shell-Scripts kamen als application/pdf durch. uploadAuthorizationDocument liest jetzt die ersten 5 Bytes und verlangt "%PDF-", sonst Loeschen + 400. 28.4 Rate-Limit auf /api/public/consent: 30 Requests pro IP pro 15min. Brute-Force-sicher war der 128-bit- UUID-Hash schon, aber ohne Limit konnte ein Angreifer das System mit Audit-Log- und Mail-Spam belasten. Live-verifiziert auf dev: alle vier Bypaesse blockiert, legitime Eingaben unangetastet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -81,3 +81,26 @@ export const passwordResetRateLimiter = rateLimit({
|
||||
res.status(options.statusCode).json(options.message);
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Public-Consent-Endpoints (/api/public/consent/:hash[/grant|/pdf]) sind
|
||||
* unauthenticated. Der hash ist 128-bit-UUID → kein Brute-Force-Risk,
|
||||
* aber DoS-Vektor: ohne Limit könnte ein Angreifer endlos POSTen und
|
||||
* den Service durch Audit-Log-Spam + Mail-Versand belasten.
|
||||
* (Pentest 2026-05-20 INFO 28.4). 30 Requests pro 15 min pro IP reicht
|
||||
* für legitime Kunden weit aus.
|
||||
*/
|
||||
export const publicConsentRateLimiter = rateLimit({
|
||||
windowMs: 15 * 60 * 1000,
|
||||
limit: 30,
|
||||
standardHeaders: 'draft-7',
|
||||
legacyHeaders: false,
|
||||
message: {
|
||||
success: false,
|
||||
error: 'Zu viele Anfragen. Bitte in 15 Minuten erneut versuchen.',
|
||||
},
|
||||
handler: (req, res, _next, options) => {
|
||||
onLimitReached('public-consent', 'MEDIUM')(req, res);
|
||||
res.status(options.statusCode).json(options.message);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user