vibesecurity.review

CWE-502

Unsafe deserialization

Read incoming files and messages through a parser that returns ordinary data values.

What can go wrong

Deserialization turns saved bytes back into values or objects. Some object formats let the parser create objects or call code. With untrusted input, this can change application state, run unintended code, or exhaust resources.

Check your application

Check who can create or change the input, including uploads and messages from other services. Review the parser settings and what the process reading that input can access.

How to fix it

  • Use a data-only format such as JSON with a parser that returns ordinary values.
  • Check parsed fields and their types against an explicit schema before using the values.
  • Limit input size and parsing depth for externally supplied data.

References