T05 · Unauthorized Access and Privilege Escalation
- Location
assets/gesture-scene.js:95- Finding
Camera Access Is Requested and Activated Automatically
- Content
View full analysis
{ this._tryStartCamera(); }); ``` ```javascript async _tryStartCamera() { if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { this.statusEl.textContent = '鼠标控制中(浏览器不支持摄像头)'; return; } try { const stream = await navigator.mediaDevices.getUserMedia({ video: true }); stream.getTracks().forEach(track => track.stop()); await this.startCamera(); } catch (error) { console.warn('摄像头权限检测失败:', error); this._handleCameraError(error); } } ``` ### Technical Analysis Creating a `GestureScene` automatically invokes `_tryStartCamera()` after loading MediaPipe. That function immediately calls `getUserMedia({ video: true })`, causing a browser permission request without a preceding, explicit in-page user action. If permission is granted, the temporary stream is stopped and `startCamera()` opens the camera again for gesture processing. Camera access is relevant to the optional gesture feature, and browser permission controls prevent access without user consent. However, requesting and activating this privacy-sensitive capability automatically violates least-privilege and user-intent principles. It also conflicts with the documented workflow in `README.md`, which states that users enable gesture control by clicking a button. No code was found that explicitly transmits camera frames to an application-controlled server. Frames are passed to the MediaPipe API for hand-landmark processing. ### Attack Path 1. A user opens a generated or reference HTML scene. 2. `GestureScene` initializes automatically. 3. MediaPipe dependencies are loaded from the CDN. 4. `_tryStartCamera()` invokes `navigator.mediaDevices.getUserMedia({ video: true })`. 5. ...[truncated 799 chars]- Remediation
View remediation
