Unsanitized user input in deserialization method

Description

It is bad practice to deserialize untrusted data, such as data that comes from external sources like user input or request parameters, without sufficient verification. 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

✅ Validate and sanitize data before attempting to (de)serialize it

Resources

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=go_lang_deserialization_of_user_input

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=go_lang_deserialization_of_user_input