hit-cxf
2026-04-09 82ad5dd7afdffd5d1fc4ca6d2d8c1af097137a8c
修复漏洞:1. 默认关闭debug 2. 防止subprocess注入攻击
2 files modified
15 ■■■■■ changed files
aigc-director/aigc-claw/backend/.env.example 2 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/core/agents/editor_agent.py 13 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/.env.example
@@ -1,7 +1,7 @@
# Server Configuration
HOST=127.0.0.1
PORT=8000
DEBUG=True
DEBUG=False
################################################# API KEYS & URLS #################################################
aigc-director/aigc-claw/backend/core/agents/editor_agent.py
@@ -119,15 +119,20 @@
                        f.write(f"file '{abs_p}'\n")
                cmd = [
                    ffmpeg_exe, '-f', 'concat', '-safe', '0',
                    ffmpeg_exe, '-y', '-f', 'concat', '-safe', '0',
                    '-i', list_file, 
                    '-c:v', 'libx264', '-preset', 'fast', '-crf', '22',
                    '-c:a', 'aac', '-pix_fmt', 'yuv420p',
                    '-movflags', '+faststart', '-y', output
                    '-movflags', '+faststart', output
                ]
                
                logger.info(f"[{sid}] Running ffmpeg for Ep {ep_idx}: {' '.join(cmd)}")
                subprocess.run(cmd, capture_output=True, text=True, check=True)
                logger.info(f"[{sid}] Running ffmpeg for Ep {ep_idx}: {cmd}")
                try:
                    result = subprocess.run(cmd, capture_output=True, text=True, check=True)
                except subprocess.CalledProcessError as e:
                    logger.error(f"FFmpeg failed with exit code {e.returncode}")
                    logger.error(f"FFmpeg stderr: {e.stderr}")
                    raise Exception(f"视频拼接失败: {e.stderr}")
                
                ep_title = ep_title_map.get(ep_idx, f"第 {ep_idx} 集")
                final_videos.append({