Deserialization of untrusted data detected.
- Rule ID: javascript_express_unsafe_deserialization
- Languages: javascript
- Source: unsafe_deserialization.yml
Description
It is bad practice to deserialize (unmarshal) untrusted data, such as data direct from the request object. Attackers can transfer payloads or malicious code via serialized data, and deserializing such data puts your application at risk.
Remediations
❌ Do not deserialize untrusted data
✅ Prefer pure (data-only) and language-agnostic (de)serialization formats such as JSON or XML
Avoiding language-specific (de)serialization formats reduces the risk of attackers manipulating the deserialization process for malicious purposes.
JSON.parse(req.params)