Security: WS-Rollenprüfung, JWT-Cookie statt localStorage, XSS/SSRF-Fixes, RDP-Consent-Secret
- WebSocket Shell/RDP: Rollenprüfung statt nur JWT-Gültigkeit (war: jeder eingeloggte User konnte fremde Agents per Shell/RDP übernehmen) - JWT_SECRET: Server bricht ab statt mit unsicherem Default weiterzulaufen - Auth: Token läuft jetzt über httpOnly-Cookie statt localStorage (XSS-Schutz gegen Session-Diebstahl) - WS-Auth: Token nicht mehr als URL-Query-Param (landete in nginx-Logs), sondern als erste Message bzw. automatisch via Cookie - Frontend: toter Rollen-Check (isSuperAdmin/isAdmin ohne Funktionsaufruf) in AgentDetailPage gefixt - XSS: DOMPurify-Sanitizing für alle marked.parse()-Renderstellen (KI-Antworten, Kommentare, Knowledge Base) - E-Mail: HTML-Escaping für alle ticket-gesteuerten Felder (auch über öffentliche Ticket-Route erreichbar) - SSRF-Schutz beim Knowledge-Base-URL-Import (blockt private/Loopback-Adressen) - TV-Dashboard: Shared-Key statt komplett offenem Endpoint - Striktes Rate-Limit auf /login, must_change_password serverseitig erzwungen - Agent (C#) v2.7.0: RDP-Consent/Disconnect/Capture verlangen jetzt ein Pro-Session-Secret (war: jeder lokale Prozess konnte Consent vortäuschen), DataDir-ACL für agent.log/status.json - FIDO-PINs AES-256-GCM-verschlüsselt statt Klartext, Retention-Job für alte patch_commands/audit_log Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -160,8 +160,12 @@ class AiController {
|
||||
const { url } = req.body;
|
||||
if (!url?.trim()) throw new AppError('URL ist erforderlich', 400);
|
||||
|
||||
// Only allow http/https
|
||||
if (!/^https?:\/\//i.test(url)) throw new AppError('Nur HTTP/HTTPS URLs erlaubt', 400);
|
||||
const { assertPublicUrl } = require('../utils/ssrfGuard');
|
||||
try {
|
||||
await assertPublicUrl(url);
|
||||
} catch (e) {
|
||||
throw new AppError(e.message, 400);
|
||||
}
|
||||
|
||||
let html;
|
||||
try {
|
||||
@@ -204,7 +208,12 @@ class AiController {
|
||||
const AiService = require('../services/ai.service');
|
||||
const { url, maxPages = 20 } = req.body;
|
||||
if (!url?.trim()) throw new AppError('URL ist erforderlich', 400);
|
||||
if (!/^https?:\/\//i.test(url)) throw new AppError('Nur HTTP/HTTPS URLs erlaubt', 400);
|
||||
const { assertPublicUrl } = require('../utils/ssrfGuard');
|
||||
try {
|
||||
await assertPublicUrl(url);
|
||||
} catch (e) {
|
||||
throw new AppError(e.message, 400);
|
||||
}
|
||||
|
||||
const limit = Math.min(Math.max(1, parseInt(maxPages) || 20), 100);
|
||||
const baseUrl = new URL(url);
|
||||
@@ -236,6 +245,7 @@ class AiController {
|
||||
visited.add(currentUrl);
|
||||
|
||||
try {
|
||||
try { await assertPublicUrl(currentUrl); } catch { continue; } // DNS-Rebinding-Schutz
|
||||
const response = await fetch(currentUrl, {
|
||||
headers: { 'User-Agent': 'Mozilla/5.0 IT-Nexus KnowledgeBase Importer' },
|
||||
signal: AbortSignal.timeout(10000),
|
||||
|
||||
Reference in New Issue
Block a user