Skip to content

fix: Upgrade Tika-Core to 3.2.2 (ATT-64) - #83

Open
ashuverma25 wants to merge 2 commits into
openmrs:masterfrom
ashuverma25:fix/ATT-64-upgrade-tika-to-3.2.2
Open

fix: Upgrade Tika-Core to 3.2.2 (ATT-64)#83
ashuverma25 wants to merge 2 commits into
openmrs:masterfrom
ashuverma25:fix/ATT-64-upgrade-tika-to-3.2.2

Conversation

@ashuverma25

Copy link
Copy Markdown

This PR addresses the security vulnerability in ATT-64 by upgrading tika-core from 2.9.2 to 3.2.2.

Changes made:

Updated pom.xml dependency version.

Migrated AttachmentsContextTest.java from deprecated org.mockito.Matchers to org.mockito.ArgumentMatchers to resolve breaking changes.

Cleaned up legacy @verifies annotations to ensure build compatibility.

Verification:
Successfully built locally using mvn clean install (Build Success).

Closes ATT-64

@sanks011

Copy link
Copy Markdown

Hey @ashuverma25 ! Thanks for jumping in to help fix this CVE! I've been looking into this issue as well, and while reviewing, I noticed a couple of things that might block this from getting merged as-is on the 4.x line:

  1. Java Compatibility: The biggest hurdle here is that tika-core 3.x requires Java 11+, but the openmrs-module-attachments 4.x branch is specifically configured to build with Java 8. Bumping Tika on this branch will cause UnsupportedClassVersionError for anyone still running on Java 8 environments.
  2. Scope of Changes: It looks like this PR bundles in a migration to ArgumentMatchers and the removal of @Verifies annotations in the api module. While these are good cleanups, they seem completely unrelated to the Tika upgrade (which is only used in the omod module). It's usually best practice to keep security PRs scoped strictly to the dependencies being patched.

Given the Java 11 requirement, Ian Bacher mentioned in the Slack thread that the best path forward is to create a new 5.x major version branch explicitly targeting Java 11+, rather than trying to force it into 4.x.

I've just opened a PR to handle the 5.x major version bump alongside this Tika patch if you'd like to collaborate or take a look at the approach there!

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants