High severityRubyInsecure DeserializationMEDIUM confidence
YAML Unsafe Load
YAML is loaded with an unsafe loader (YAML.load / unsafe_load / Psych.load), which can instantiate arbitrary Ruby objects and lead to RCE (CWE-502).
Standards mapping
- OWASP Top 10
- A08:2021 - Software and Data Integrity Failures
- OWASP ASVS
- V5.5.3 (L1)
Vulnerable vs. safe
Flagged by this check
config = YAML.load(request.body.read)Passes - the safe pattern
config = YAML.safe_load(request.body.read)Why it matters & how to fix it
YAML is loaded with an unsafe loader (YAML.load / unsafe_load / Psych.load), which can instantiate arbitrary Ruby objects and lead to RCE (CWE-502). Use YAML.safe_load with an explicit permitted_classes allow-list for any externally influenced data.
References
Rule ID integsec-ruby-yaml-unsafe-load - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Insecure DeserializationNode Serialize Unserialize
- JavaScript / TypeScript - Insecure DeserializationYAML Unsafe Load
- Python - Insecure DeserializationJsonpickle Decode
- Python - Insecure DeserializationPickle Load
- Python - Insecure DeserializationYAML Unsafe Load
- Java - Insecure DeserializationJackson Default Typing