Visitar URL original
Missing methods and constructors in Java GSON model · Issue #14924 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20260623032452/https://github.com/github/codeql/issues/14924
Skip to content

Missing methods and constructors in Java GSON model  #14924

Description

@ebickle

Description of the issue

com.google.gson.model.yml is missing some constructors and methods that cause some security vulnerabilities to be missed by CodeQL.

  • The com.google.gson.stream.JsonReader and com.google.gson.stream.JsonWriter constructors. CodeQL already supports the Gson.newJsonReader and Gson.newJsonWriter helper methods, but not the lower level direct instantiation.
  • The getAsJsonArray, getAsJsonObject, and getAsJsonPrimitive overloads on com.google.gson.JsonObject that accept a String as argument 0 are missing. These are helper methods that can access a child property directly as a GSON type. CodeQL already supports these methods without arguments on the base JsonElement type.
  • The parseReader and parseString methods on com.google.gson.JsonParser. These are lower level functions that directly parse JSON and allow it to be traversed.

These were discovered by using the new Visual Studio Code Model Editor plugin and uncovered an issue or two in our code. Shout out to the team for writing that new UI - it's a fantastic tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions