fix: address CodeQL security findings (v0.5.2)
- Rate-limit SPA fallback route (missing rate limiting on fs access) - Add csrfMiddleware to all state-changing auth routes (logout, create user, change password, delete user) — previously bypassed global CSRF middleware due to router registration order - Fix incomplete vCard escaping: escape backslashes before other special characters to prevent injection via contact fields - Restrict CI GITHUB_TOKEN to contents: read (least privilege) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -171,7 +171,7 @@ router.get('/:id/vcard', (req, res) => {
|
||||
const contact = db.get().prepare('SELECT * FROM contacts WHERE id = ?').get(id);
|
||||
if (!contact) return res.status(404).json({ error: 'Kontakt nicht gefunden', code: 404 });
|
||||
|
||||
const esc = (v) => String(v || '').replace(/\n/g, '\\n').replace(/,/g, '\\,').replace(/;/g, '\\;');
|
||||
const esc = (v) => String(v || '').replace(/\\/g, '\\\\').replace(/\n/g, '\\n').replace(/,/g, '\\,').replace(/;/g, '\\;');
|
||||
|
||||
const lines = [
|
||||
'BEGIN:VCARD',
|
||||
|
||||
Reference in New Issue
Block a user