Problem/Motivation

Codex identified the following issue:

Medium: malformed JSON can pass if the schema permits null or is permissive.
     /dev/json_schema_validator/src/JsonSchemaValidator.php:101 decodes JSON, validates the result, and only checks decode failure
     after validation fails. Malformed JSON becomes NULL; if a schema accepts null or lacks a root type, invalid input can be accepted.
     Check json_last_error() immediately or use JSON_THROW_ON_ERROR before calling Opis.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Title: Malformed JSON can be accepted if the schema accepts NULL » Reject malformed JSON even if the schema accepts null

  • ptmkenny committed 818cda81 on 1.0.x
    fix: #3605384 Reject malformed JSON even if the schema accepts null
    
    By...
ptmkenny’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.