-
Notifications
You must be signed in to change notification settings - Fork 0
Fix path traversal vulnerability and resolve ESLint security warnings #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
Co-authored-by: aurelianware <194855645+aurelianware@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR hardens filesystem usage in the video recording pipeline to eliminate a path traversal vulnerability and aligns ESLint/security tooling by distinguishing real issues from vetted false positives. It also updates the vulnerability assessment documentation to reflect the latest security posture and tooling status.
Changes:
- Enforced directory and file path validation in
VideoStreamHandlerusingpath.resolve/path.relativeto ensure all recording outputs stay underprocess.cwd()and share a single validated timestamp. - Tuned ESLint config (browser/Node globals) and added targeted
eslint-disablecomments around safe indexed array/object access to clear known false positives from the security plugin. - Expanded
VULNERABILITY_ASSESSMENT.mdwith Phase 3 hardening details, the path traversal fix, and current scan/CodeQL status.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/utils/syncQueue.ts |
Adds a narrow eslint-disable for indexed access when iterating the sync queue, clarifying that the access pattern is controlled and safe. |
src/services/VideoStreamHandler.ts |
Introduces robust validation for storageDir and per-recording file paths plus guarded fs calls to prevent path traversal while keeping recording behavior intact. |
src/services/ThermalAnalyzer.ts |
Marks specific indexed accesses on typed arrays and visitation flags as intentional to silence object-injection false positives. |
src/services/AutelDroneSDK.ts |
Documents safe indexed access for polygon vertices and waypoint arrays to avoid spurious security warnings. |
src/lib/stripe.ts |
Adds scoped disables for plan lookups by enum key in SUBSCRIPTION_PLANS, clarifying that keys are type-validated, not user-controlled. |
src/drone/missions/MissionPlanner.ts |
Annotates indexed waypoint access in mission distance calculation as safe, resolving a security plugin false positive. |
eslint.config.js |
Extends global definitions for common browser APIs and Buffer and clarifies Node/server-side usage to make ESLint’s environment assumptions accurate. |
VULNERABILITY_ASSESSMENT.md |
Documents the path traversal fix, ESLint security configuration work, affected files, and up-to-date scan/CodeQL results, plus updated security status metadata. |
|
@copilot fix the failing checks failing checks |
Summary
Resolved path traversal vulnerability in VideoStreamHandler and eliminated 22 ESLint security warnings through proper validation and configuration updates.
What changed
Path traversal fix in VideoStreamHandler.ts: Implemented
path.relative()validation to prevent directory escape attacks. Constructor andstartRecording()now verify paths don't contain..or absolute paths in relative form, blocking exploits like/app-evil/../../etc/passwdESLint configuration enhancement: Added missing globals (localStorage, requestAnimationFrame, cancelAnimationFrame, atob, btoa, crypto, Buffer) and removed unnecessary React global
False positive warnings: Added
eslint-disablecomments for safe array/object access in MissionPlanner, stripe helpers, AutelDroneSDK, ThermalAnalyzer, and syncQueue (controlled loop indices, TypeScript-validated keys)Documentation: Updated VULNERABILITY_ASSESSMENT.md with Phase 3 security hardening details
Testing
Security/Compliance
Screenshots
N/A - Backend security fixes
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.