Medium severityJavaScript / TypeScriptInsecure DeserializationMEDIUM confidence
YAML Unsafe Load
Legacy js-yaml load()/loadAll() without a SAFE_SCHEMA can instantiate arbitrary types from untrusted YAML.
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
const doc = yaml.load(input, { schema: yaml.DEFAULT_FULL_SCHEMA });Passes - the safe pattern
const safeDoc = yaml.load(input, { schema: yaml.JSON_SCHEMA });Why it matters & how to fix it
Legacy js-yaml load()/loadAll() without a SAFE_SCHEMA can instantiate arbitrary types from untrusted YAML. Use yaml.load(input, {schema: yaml.JSON_SCHEMA}) or the default safe schema on current versions.
References
Rule ID integsec-js-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
- Python - Insecure DeserializationJsonpickle Decode
- Python - Insecure DeserializationPickle Load
- Python - Insecure DeserializationYAML Unsafe Load
- Java - Insecure DeserializationJackson Default Typing
- Java - Insecure DeserializationObject Input Stream Readobject