An application developer is reviewing security logs following an incident where a backend microservice was compromised. The investigation reveals that an external attacker submitted a base64-encoded serialized object within an HTTP header, triggering execution of arbitrary system commands on the hosting server. Which of the following vulnerabilities was exploited, and what is the most effective code-level remediation to prevent future occurrences?
- Insecure deserialization; replace object serialization with a safe data format like JSON or implement strict type validation on object streams.Cevap
- BCross-site scripting (XSS); implement context-aware output encoding and sanitize all untrusted parameter inputs on the client side.
- CBroken authorization; enforce mandatory multi-factor authentication (MFA) and role-based access control (RBAC) on the endpoint.
- DUnrestricted egress traffic; configure network-layer firewall rules and microsegmentation to block outgoing server connections.
Cevap
Insecure deserialization; replace object serialization with a safe data format like JSON or implement strict type validation on object streams.
Insecure deserialization occurs when an application receives serialized objects from untrusted sources and reconstructs them without adequate validation. Attackers manipulate serialized data structures to execute arbitrary commands on the application server. The primary remediation is to replace native object serialization with safer data interchange formats, such as JSON or Protocol Buffers, or strictly validate allowed object classes before instantiation.
Adım Adım Çözüm
Anahtar Kavram
Insecure Deserialization Vulnerability and Remediation