Skip to content

Updated and removed some dependencies for security purpose#324

Closed
kateyang1998 wants to merge 22 commits intodevelop/coyotefrom
issue-322
Closed

Updated and removed some dependencies for security purpose#324
kateyang1998 wants to merge 22 commits intodevelop/coyotefrom
issue-322

Conversation

@kateyang1998
Copy link
Copy Markdown

@kateyang1998 kateyang1998 commented Jun 26, 2025

Issue described in #322

Summary by Sourcery

Secure project dependencies by bumping library versions, adding security-focused libraries, and excluding vulnerable transitive dependencies

New Features:

  • Add commons-beanutils 1.11.0, dom4j 2.1.4, and OWASP ESAPI 2.6.2.0 as direct dependencies

Enhancements:

  • Upgrade HAPI FHIR to 6.4.0, MySQL Connector/J to 9.3.0, WebDriverManager to 6.1.0, and Apache CXF HTTP transport to 3.3.0
  • Exclude commons-beanutils from multiple dependencies to mitigate security vulnerabilities
  • Exclude xalan, serializer, Bouncy Castle, and ESAPI transitive libraries from specific dependencies

@kateyang1998 kateyang1998 requested a review from yingbull June 26, 2025 20:16
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Jun 26, 2025

Reviewer's Guide

This PR strengthens security by upgrading several dependencies to safer versions, adding direct management of vulnerable libraries, and systematically excluding risky transitive dependencies in the Maven configuration.

File-Level Changes

Change Details Files
Upgraded primary dependencies to newer, secure versions
  • Bumped HAPI FHIR from 5.4.0 to 6.4.0
  • Updated MySQL connector to com.mysql:mysql-connector-j 9.3.0
  • Advanced WebDriverManager from 3.8.1 to 6.1.0
  • Set CXF transports HTTP to 3.3.0 and added CXF WS-Security 3.2.0
pom.xml
Introduced direct dependency declarations for better control
  • Added commons-beanutils 1.11.0
  • Added dom4j 2.1.4
  • Added OWASP ESAPI 2.6.2.0
pom.xml
Excluded vulnerable transitive dependencies
  • Excluded commons-beanutils variants from multiple Apache Commons and third-party modules
  • Excluded Xalan and serializer from XML-related dependencies
  • Excluded BouncyCastle and ESAPI from CXF and Woodstox configurations
pom.xml
Removed obsolete or insecure artifacts
  • Replaced old mysql-connector-java entry with com.mysql connector
  • Commented unnecessary dependency link causing 404 when removed
pom.xml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @kateyang1998 - I've reviewed your changes - here's some feedback:

  • Consider consolidating repeated transitive exclusions and version overrides into a dependencyManagement section to reduce duplication.
  • Align CXF module versions—cxf-rt-ws-security is still at 3.2.0 while transport is 3.3.0—to avoid incompatibilities.
  • Remove redundant exclusions for libraries now included directly (e.g., ESAPI, dom4j, Beanutils) to simplify your POM.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider consolidating repeated transitive exclusions and version overrides into a dependencyManagement section to reduce duplication.
- Align CXF module versions—cxf-rt-ws-security is still at 3.2.0 while transport is 3.3.0—to avoid incompatibilities.
- Remove redundant exclusions for libraries now included directly (e.g., ESAPI, dom4j, Beanutils) to simplify your POM.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- Added commons-httpclient and jersey-client dependencies since these are not included in axis2 1.8.0
- Modified some relevant classes to make them fully compatible
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
</exclusion>
<exclusion>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can you explain this? we are excluding cxf?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall we need more documentation; it helps reviewers and further people working on the code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@yingbull, these are the libraries that triggered the security issues, but are not being used. Excluding them won't impact cxf's functionality in our project, I will add some comments.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@yingbull added comments.

@yingbull yingbull self-requested a review July 16, 2025 17:14
yingbull
yingbull previously approved these changes Jul 16, 2025
@yingbull yingbull marked this pull request as draft July 16, 2025 17:18
@yingbull yingbull marked this pull request as ready for review July 17, 2025 18:54
@yingbull
Copy link
Copy Markdown

@kateyang1998 could you resolve the conflicts and test this is still good and working when merged in with current coyote, and I will finish the review? Change it from draft to ready to review when that is the case.

@yingbull yingbull marked this pull request as draft July 17, 2025 18:55
@socket-security
Copy link
Copy Markdown

socket-security bot commented Jul 17, 2025

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
com.ibm.icu/icu4j@72.1 has Obfuscated code.

Confidence: 0.90

Location: Package overview

From: pom.xmlmaven/ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3@6.4.0maven/com.ibm.icu/icu4j@72.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/com.ibm.icu/icu4j@72.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@kateyang1998
Copy link
Copy Markdown
Author

@kateyang1998 could you resolve the conflicts and test this is still good and working when merged in with current coyote, and I will finish the review? Change it from draft to ready to review when that is the case.

There are 46 compilation errors after merged with coyote, resolving now

@kateyang1998
Copy link
Copy Markdown
Author

@yingbull all good now.

kateyang1998 and others added 3 commits July 18, 2025 14:57
- Replaced net.sf.json with jackson-databind in CaseloadContent2Action
- Updated StringEscapeUtils usage

Co-Authored-By: aider (deepseek/deepseek-chat) <aider@aider.chat>
@kateyang1998
Copy link
Copy Markdown
Author

@yingbull there are some error after resolve the conflict, I'm looking into them now.

@kateyang1998 kateyang1998 marked this pull request as ready for review August 12, 2025 17:44
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @kateyang1998, you have reached your 24-hour rate limit for Sourcery. Please try again later

@socket-security
Copy link
Copy Markdown

socket-security bot commented Aug 28, 2025

@yingbull
Copy link
Copy Markdown

Thanks for the work on this! It is generating JSP errors on compile though.

@LiamStanziani can you review this when you start back, and see what we've learned here we can apply to a new branch/pr against Dogfish?

@yingbull yingbull self-requested a review August 29, 2025 21:45
Copy link
Copy Markdown

@yingbull yingbull left a comment

Choose a reason for hiding this comment

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

many compile errors on jsps.

@LiamStanziani
Copy link
Copy Markdown
Collaborator

PR is fully passing now (fixed up remaining jsp compilation errors, CodeQL, and test failures). I would like to test this to ensure nothing is breaking with these changes.

@yingbull would you like me to still move the changes over to a develop/dogfish branch? or would you like this to be merged into develop/coyote and then moved over through a merge?

@yingbull
Copy link
Copy Markdown

yingbull commented Sep 1, 2025

if this is targeting coyote, confirm it is working well and we can merge to coyote.

If you can cleanly enough merge to dogfish, I am okay with it - depending on what files are touched that may be fine, or ugly.

In generally my approach here on would be to be pr to just dogfish.

@LiamStanziani LiamStanziani linked an issue Sep 1, 2025 that may be closed by this pull request
@LiamStanziani
Copy link
Copy Markdown
Collaborator

I think the PR is working well, although after further review I think the merge to dogfish will be quite ugly. I am going to create a branch off dogfish and move it over as you said before

@LiamStanziani
Copy link
Copy Markdown
Collaborator

Closing this PR since it has been moved and merged to a branch based off of develop/dogfish, merging this would probably cause issues as well.

PR: #494

@yingbull yingbull deleted the issue-322 branch January 8, 2026 19:24
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.

4 participants