Skip to content

A potential concurrent bug on the Utils.sanitizeJson #4408

@NEUZhangy

Description

@NEUZhangy

Describe the bug
A potential concurrent bug on the crafted JSON file to sanitizeJson and cause an exception. This is related to
the U+FFFD Unicode replacement character.
To Reproduce

  @Test
  public void testsanitizer() throws Exception {
    String input = "\u0010{'\u0000\u0000'\"\u0000\"{.\ufffd-0X29295909049550970,\n\n0";
    String want = "{\"\\u0000\\u0000\":\"\\u0000\",\"\":{\"0\":-47455995597866469744,\n\n\"0\":null}}";
    String got = Utils.sanitizeJson(input);
    assertEquals(want, got);
  }

Screenshots
If applicable, add screenshots to help explain your problem.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions