Summary
Audit for unsafe YAML deserialization (YAML.load, YAML.load_file) as part of Rails 7 + Ruby/Psych upgrades.
Approach
Run:
rg -n "\\bYAML\\.load\\b|\\bYAML\\.load_file\\b" --glob "*.rb"
For each call site:
- Determine whether the YAML input is trusted (static config under our control) or untrusted (user-supplied, HTTP params, file uploads, external feeds).
- If untrusted or ambiguous, replace with
YAML.safe_load and explicitly list permitted classes/symbols.
- If trusted and intentionally using
YAML.load, add an inline comment explaining why the input is trusted and bounded.
Acceptance Criteria
Verification Plan
- Run the grep above and patch call sites
- Run:
bundle exec rake test (affected engine(s) or default)
Summary
Audit for unsafe YAML deserialization (
YAML.load,YAML.load_file) as part of Rails 7 + Ruby/Psych upgrades.Approach
Run:
For each call site:
YAML.safe_loadand explicitly list permitted classes/symbols.YAML.load, add an inline comment explaining why the input is trusted and bounded.Acceptance Criteria
YAML.load*usage is explicitly justified with a trust boundary commentVerification Plan
bundle exec rake test(affected engine(s) or default)