T09 · Insecure Skill Coding Practices
- Location
scripts/video_enhance.py:439- Finding
Documented Video Upload Limits Are Not Enforced
- Content
View full analysis
1920`, duration must not exceed 60 seconds. The implementation only verifies that width, height, and duration are nonzero. It does not compare the extracted metadata against either declared duration limit. Consequently, a video outside the consented and documented processing constraints proceeds directly to `enhance()`, which uploads the complete source file. ...[truncated 1211 chars]- Remediation
View remediation
300: log_error( f"Video duration {video_duration:.1f}s exceeds the 300-second limit " "for videos at or below 1920 pixels." ) sys.exit(1) if max_dimension > 1920 and video_duration > 60: log_error( f"Video duration {video_duration:.1f}s exceeds the 60-second limit " "for videos above 1920 pixels." ) sys.exit(1) ``` Also: 1. Reject non-finite, negative, malformed, or missing metadata. 2. Keep all validation in a dedicated function invoked immediately before upload. 3. Add tests for 60-, 300-, and just-over-limit boundary values. 4. Ensure no network request occurs when validation fails. 5. Align the code, documentation, and provider-side limits so the declared consent boundary cannot diverge from actual behavior. ]]>
