Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for CVE-2023-51074 and CVE-2023-5072 #92

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

joseph-neeraj
Copy link
Contributor

PR checklist

  • An issue/feature request has been created for this PR
  • Pull Request title clearly describes the work in the pull request and the Pull Request description provides details about how to validate the work. Missing information here may result in a delayed response.
  • File the PR against the main branch
  • The code in this PR is covered by unit tests

Link to issue/feature request: #90

Description

Updates the org.json.json and com.jayway.jsonpath.json-path libraries which fix CVE-2023-51074 and CVE-2023-5072.

Had to make code changes because the json-path library introduced a bug in the updated version which fails a few unit tests in our repo. See this PR to track the issue json-path/JsonPath#871

Updates the org.json.json and com.jayway.jsonpath.json-path libraries which fix CVE-2023-51074 and CVE-2023-5072.

Had to make code changes because the json-path library introduced a bug in the updated version which fails a few unit tests in our repo.
See this PR to track the issue json-path/JsonPath#871
@@ -86,4 +86,16 @@ static Object readJsonObject(DocumentContext context, String jsonPathString) {
}
return jsonElement;
}

// Upgrading the json-path lib from 2.6.0 to 2.9.0 introduced a bug where when you
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant : remove all of this: // try to delete a non-existent key in a DocumentContext with the SUPPRESS_EXCEPTIONS flag,
// it would throw a ClassCastException. This method is a workaround for the issue.
// Once this issue is fixed this method's usages can be replaced with a simple DocumentContext.delete(path).
// Track the issue here json-path/JsonPath#870

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could leave this comment in until this issue is fixed. It's a good way to make sure we revisit it in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, folks, I would insist that we remove this comment. There will be no reason to update this library, unless another security issue. let keep it code clean.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed it now.

@@ -86,4 +86,16 @@ static Object readJsonObject(DocumentContext context, String jsonPathString) {
}
return jsonElement;
}

// Upgrading the json-path lib from 2.6.0 to 2.9.0 introduced a bug where when you
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant : remove all of this: // try to delete a non-existent key in a DocumentContext with the SUPPRESS_EXCEPTIONS flag,
// it would throw a ClassCastException. This method is a workaround for the issue.
// Once this issue is fixed this method's usages can be replaced with a simple DocumentContext.delete(path).
// Track the issue here json-path/JsonPath#870

Copy link
Contributor

@danny-gallagher danny-gallagher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -86,4 +86,16 @@ static Object readJsonObject(DocumentContext context, String jsonPathString) {
}
return jsonElement;
}

// Upgrading the json-path lib from 2.6.0 to 2.9.0 introduced a bug where when you
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, folks, I would insist that we remove this comment. There will be no reason to update this library, unless another security issue. let keep it code clean.

@joseph-neeraj joseph-neeraj force-pushed the fix/CVE-2023-51074andCVE-2023-5072 branch from 9f57f5e to 265773d Compare April 15, 2024 13:08
Copy link
Contributor

@karen-avetisyan-mc karen-avetisyan-mc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joseph-neeraj joseph-neeraj merged commit d347e61 into main Apr 15, 2024
8 checks passed
@joseph-neeraj joseph-neeraj deleted the fix/CVE-2023-51074andCVE-2023-5072 branch April 15, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants