T05 · Unauthorized Access and Privilege Escalation
- Location
install.sh:9- Finding
VNC and Unsandboxed Chrome Are Configured to Run as Root
- Content
View full analysis
$VNC_HOME/.vnc/xstartup << 'EOF' #!/bin/bash unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec startxfce4 EOF chmod +x $VNC_HOME/.vnc/xstartup chown -R $VNC_USER:$VNC_USER $VNC_HOME/.vnc # 5. 提示用户设置 VNC 密码 echo "" echo "🔐 请设置 VNC 密码:" su - $VNC_USER -c "vncpasswd" # 6. 启动 VNC echo "🚀 启动 VNC 服务器..." su - $VNC_USER -c "vncserver :1 -geometry 1920x1080 -depth 24" ``` ```bash cat > $VNC_HOME/start-chrome.sh << 'EOF' #!/bin/bash export DISPLAY=:1 google-chrome \ --remote-debugging-port=18800 \ --no-sandbox \ --disable-gpu \ --disable-dev-shm-usage \ --user-data-dir=/home/$(whoami)/.config/openclaw-browser-openclaw \ > /tmp/chromium.log 2>&1 & echo "✅ Chrome 已启动(端口 18800)" echo "📄 日志:/tmp/chromium.log" EOF ``` ### Technical Analysis The installer refuses to run unless its effective user is root. It then uses `whoami` to determine `VNC_USER`. Because the effective user is necessarily root at this point, `VNC_USER` and `VNC_HOME` resolve to `root` and `/root`. As a result: - The VNC password and desktop configuration are created for root. - The VNC desktop is started as root. - The generated Chrome launcher is placed under `/root`. - Chrome runs in the root desktop session. - Chrome's process sandbox is explicitly disabled with `--no-sandbox`. - The persistent browser profile can contain authenticated cookies and other sensitive session data under root-owned storage. Running a remotely accessible graphical desktop and web browser as root substantially exceeds the minimum privileges needed for browser automation. Disabling Chrome's sandbo ...[truncated 1458 chars]- Remediation
View remediation
