Skip to content

🛡️ Sentinel: [HIGH] Fix path traversal in scene downloads#162

Merged
ImChong merged 1 commit into
mainfrom
sentinel/fix-path-traversal-10545686341381630955
Jun 30, 2026
Merged

🛡️ Sentinel: [HIGH] Fix path traversal in scene downloads#162
ImChong merged 1 commit into
mainfrom
sentinel/fix-path-traversal-10545686341381630955

Conversation

@ImChong

@ImChong ImChong commented Jun 30, 2026

Copy link
Copy Markdown
Owner
  • 🚨 Severity: HIGH
  • 💡 Vulnerability: 路径穿越 (Path Traversal / Zip Slip)。downloadExampleScenesFolder 方法从 JSON 获取的相对路径未经过滤即写入虚拟机文件系统,攻击者可能通过构造恶意的 files.json 将文件写入 /working/ 之外的任意目录。
  • 🎯 Impact: 攻击者可修改 MuJoCo 虚拟环境内的系统配置或重写其他加载的组件,导致沙盒内代码执行环境被篡改。
  • 🔧 Fix: 在写入前,增加针对 /(^|\/)\.\.(\/|$)/ 结构和 / 开头的校验逻辑,检测到越权路径时抛出异常。
  • ✅ Verification: 运行测试并验证了正则不会误杀类似 my..file.txt 的合法文件名,仅过滤目录切换符。

PR created automatically by Jules for task 10545686341381630955 started by @ImChong

在 `src/simulation/mujocoUtils.js` 中,`downloadExampleScenesFolder` 会将外部文件直接写入 MuJoCo 虚拟文件系统。如果 `relativePath` 包含恶意路径(如 `../` 或 `/`),可能导致跨目录写入。增加正则匹配 `/(^|\/)\.\.(\/|$)/` 以及绝对路径校验,以安全阻断目录穿越行为,同时允许文件名内合法包含 `..`。

Co-authored-by: ImChong <74563097+ImChong@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@ImChong ImChong merged commit 51dc547 into main Jun 30, 2026
1 check passed
@ImChong ImChong deleted the sentinel/fix-path-traversal-10545686341381630955 branch June 30, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant