Skip to content

🔒 Fix Insecure YAML Deserialization in Scripts - #35

Merged
hahwul merged 1 commit into
mainfrom
security-fix-yaml-load-5666713803620845012
Mar 1, 2026
Merged

🔒 Fix Insecure YAML Deserialization in Scripts#35
hahwul merged 1 commit into
mainfrom
security-fix-yaml-load-5666713803620845012

Conversation

@hahwul

@hahwul hahwul commented Mar 1, 2026

Copy link
Copy Markdown
Owner

🎯 What: The vulnerability fixed is an insecure YAML deserialization using YAML.load in scripts/validate_weapons.rb and scripts/erb.rb.
⚠️ Risk: If an attacker can introduce a malicious YAML file into the weapons/ directory, the old YAML.load method in earlier Ruby versions allows instantiation of arbitrary Ruby objects, potentially leading to Remote Code Execution (RCE) when the scripts are executed.
🛡️ Solution: The fix replaces YAML.load(File.open(...)) with YAML.safe_load_file(...), which is safe against instantiating arbitrary classes and only parses safe, native types like Hashes, Arrays, and Strings by default.

Note: Since scripts/erb.rb re-read the directory indiscriminately without sorting, executing it generated a minor shuffling in some tables within README.md and categorize/ markdown files, which have been committed along with the fixes.


PR created automatically by Jules for task 5666713803620845012 started by @hahwul

Replace `YAML.load` with `YAML.safe_load_file` in both `scripts/validate_weapons.rb` and `scripts/erb.rb` to prevent potential Remote Code Execution (RCE) vulnerabilities from parsing untrusted YAML content.
@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.

@hahwul
hahwul merged commit e10dcbb into main Mar 1, 2026
2 checks passed
@hahwul
hahwul deleted the security-fix-yaml-load-5666713803620845012 branch March 1, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant