Skip to content

Custom JSON Deserialization

Description

The use of `json_create` class method implies custom JSON deserialization, which can lead to Remote Code Execution (RCE) and other deserialization-type bugs. Usage should be audited and, at least, fuzzed.

Examples

Insecure Code

ruby
class User
  def self.json_create(object)
    # deserialization code
  end
end

Secure Code

ruby
class User
  def self.safe_json_create(object)
    # safe deserialization code
  end
end

Remediation

Audit and fuzz the usage of `json_create` method to ensure it does not deserialize untrusted data. Consider using safe deserialization methods.

Rule Details

FieldValue
IDCODE-0798
CategoryDeserialization
SeverityHIGH
CWECWE-502
ConfidenceLOW
ImpactHIGH
LikelihoodLOW
ExploitabilityCOMPLEX
Tagsdeserialization, RCE
OWASPN/A

References