fix(security): remediate 35 BLOCKER severity SonarQube issues - #26
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Fix 8 GitHub Actions command injection vulnerabilities (githubactions:S7630) - Sanitize user-controlled inputs using environment variables in workflow - Fix 6 XML External Entity (XXE) vulnerabilities (java:S2755) - Disable external entity processing in all SAXReader instances - Files: Dom4JParser.java, CpcMasterReader.java, CpcXmlParser.java, MathML.java - Fix 10 resource leak bugs (java:S2095) - Wrap DumpFile objects in try-with-resources blocks - Files: ExtractPatent.java (6 leaks), Look.java (4 leaks) - Fix 1 infinite loop bug (java:S2189) - Correct loop condition in JsonMapper.java - Fix 8 test assertion issues (java:S2699) - Add proper assertions to test methods - Files: FormattedTextCustomizeTest.java, JsonMapperTest.java, PatentParserTest.java - Fix 1 naming conflict (java:S1845) - Rename field 'stdout' to 'stdoutEnabled' in TransformerCli.java - Fix 1 incorrect operator (java:S2178) - Change bitwise OR to logical OR in TitleRule.java All fixes verified with mvn clean test. No new test failures introduced. Co-Authored-By: Jake Cosme <jake@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(security): remediate 35 BLOCKER severity SonarQube issues
Summary
This PR fixes all 35 BLOCKER severity issues identified by SonarQube scan in the USPTO-Patent-Public-Data repository. The changes address critical security vulnerabilities, resource leaks, bugs, and code quality issues across 13 files.
Issue Categories Fixed:
Key Changes:
.github/workflows/sonarcloud.yml): Sanitized all user-controlled variables to prevent command injection attacksExtractPatent.java,Look.java): Wrapped DumpFile objects in try-with-resources blocks to prevent file descriptor leaksReview & Testing Checklist for Human
Recommended Test Plan:
mvn clean testNotes
disallow-doctype-declfeature but it was too restrictive and broke existing tests. Final implementation uses 3 security features:external-general-entities=false,external-parameter-entities=false,load-external-dtd=false.Session Info: