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:
@@ -177,10 +177,9 @@ function RemoteShell({ agentId, agentHostname }) {
|
||||
const inputRef = useRef(null);
|
||||
|
||||
const getWsUrl = () => {
|
||||
const token = localStorage.getItem('token');
|
||||
const proto = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
||||
const host = window.location.host;
|
||||
return `${proto}://${host}/ws?type=shell&agentId=${agentId}&token=${token}`;
|
||||
return `${proto}://${host}/ws?type=shell&agentId=${agentId}`;
|
||||
};
|
||||
|
||||
const connect = () => {
|
||||
@@ -191,7 +190,10 @@ function RemoteShell({ agentId, agentHostname }) {
|
||||
const ws = new WebSocket(getWsUrl());
|
||||
wsRef.current = ws;
|
||||
|
||||
ws.onopen = () => setStatus('connected');
|
||||
ws.onopen = () => {
|
||||
ws.send(JSON.stringify({ type: 'auth', token: localStorage.getItem('token') }));
|
||||
setStatus('connected');
|
||||
};
|
||||
|
||||
ws.onmessage = (e) => {
|
||||
setOutput(prev => prev + stripAnsi(e.data));
|
||||
@@ -766,7 +768,7 @@ export default function AgentDetailPage() {
|
||||
</div>
|
||||
|
||||
{/* ── REMOTE TOOLS ─────────────────────────────────────────────────── */}
|
||||
{(isSuperAdmin || isAdmin) && (
|
||||
{(isSuperAdmin() || isAdmin()) && (
|
||||
<div style={{ marginTop: 24 }}>
|
||||
<div style={{ display: 'flex', gap: 4, marginBottom: 0, borderBottom: '1px solid var(--border-color)' }}>
|
||||
{[
|
||||
@@ -790,10 +792,6 @@ export default function AgentDetailPage() {
|
||||
{shellTab === 'rdp' && <RemoteDesktop agentId={agent.id} agentHostname={agent.hostname} />}
|
||||
</div>
|
||||
)}
|
||||
{!isSuperAdmin && !isAdmin && (
|
||||
<RemoteShell agentId={agent.id} agentHostname={agent.hostname} />
|
||||
)}
|
||||
|
||||
{/* ── ANKÜNDIGUNG MODAL ────────────────────────────────────────────── */}
|
||||
{showAnnModal && (
|
||||
<div style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,.6)', zIndex: 1000, display: 'flex', alignItems: 'center', justifyContent: 'center' }}
|
||||
|
||||
Reference in New Issue
Block a user