Skip to content

fix(cve): patch 5 CVEs in jackson/postgresql; wire up shiro & jline fork WIP - #39

Merged
kycheng merged 5 commits into
AlaudaDevops:alauda-76.0from
kycheng:fix/76-vul07
Jul 6, 2026
Merged

fix(cve): patch 5 CVEs in jackson/postgresql; wire up shiro & jline fork WIP#39
kycheng merged 5 commits into
AlaudaDevops:alauda-76.0from
kycheng:fix/76-vul07

Conversation

@kycheng

@kycheng kycheng commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Second-round CVE remediation for the 3.76.0-03 Nexus image. Rebuild + smoke tested locally (Nexus starts cleanly, 10/10 smoke tests pass, HTTP 200 on 8081).

Fixed in this PR (rebuild + smoke test verified)

CVE Severity Component Fix
CVE-2026-54512 HIGH jackson-databind bump 2.17.0 → 2.18.8
CVE-2026-54513 HIGH jackson-databind bump 2.17.0 → 2.18.8
CVE-2026-54514 MED jackson-databind bump 2.17.0 → 2.18.8
CVE-2026-42198 MED postgresql JDBC bump 42.7.2 → 42.7.11

To satisfy jackson-databind's OSGi Import-Package [2.18, 3.0) constraint, jackson-core is bumped 2.18.6 → 2.18.8 and a new jackson-annotations 2.17.0 → 2.18.8 replace step is added.

New .trivyignore exemptions

  • CVE-2026-54515 (MED, jackson-databind) — fix versions 2.18.9 / 2.21.5 not yet on Maven Central as of 2026-07-02; only 3.1.4 (major bump, incompatible with Nexus) has the fix. Revisit when 2.18.9 lands.
  • CVE-2026-23901 (LOW, shiro-core) — already backported in the 1.13.1-alauda fork; Trivy still matches by version string < 2.1.0.

Still open — fork PRs pending

The following require an upstream JAR release before the Containerfile can pick them up. Fork PRs are already prepared:

CVE Severity Component Fork PR
CVE-2026-49268 HIGH shiro-core LDAP DN injection AlaudaDevops/shiro#3
CVE-2026-43827 MED shiro-core session fixation AlaudaDevops/shiro#3
CVE-2026-43828 MED shiro-web insecure cookie AlaudaDevops/shiro#3
CVE-2026-56740 HIGH jline-remote-telnet NEW-ENVIRON DoS AlaudaDevops/jline3#2
CVE-2026-56741 HIGH jline-remote-telnet NAWS DoS AlaudaDevops/jline3#2

Rationale for the fork route (documented in the PRs):

  • Shiro 2.x breaks OSGi (Karaf-hosted Nexus imports shiro packages with [1.13, 2.0) range)
  • JLine 4.x breaks OSGi (Karaf shell.core 4.3.9 imports jline packages with [3.21, 4) range)

Once each fork PR merges + a tag is pushed, the release workflows I added produce shiro-core-1.13.2-alauda.jar / shiro-web-1.13.2-alauda.jar and jline-3.21.0-alauda.jar. Follow-up PR will bump the TODO(sec) markers left in Containerfile.

Test plan

  • ./hack/build-nexus-image.sh --tag nexus-test:vul-partial succeeds
  • ./hack/local-smoke-test.sh run --image nexus-test:vul-partial passes 10/10
  • ./hack/scan-image.sh --image nexus-test:vul-partial confirms the 4 fixed CVEs disappear from the report
  • Nexus responds with HTTP 200 on :8081/
  • No OSGi bundle resolution errors in container logs
  • CI green
  • Follow-up bump of shiro/jline fork versions after fork PRs release

🤖 Generated with Claude Code

Applied fixes in this pass (rebuild + smoke test verified — Nexus 3.76.0-03
starts cleanly, all 10 smoke tests pass, HTTP 200 on 8081):

- CVE-2026-54512 HIGH  jackson-databind 2.17.0 -> 2.18.8
- CVE-2026-54513 HIGH  jackson-databind 2.17.0 -> 2.18.8
- CVE-2026-54514 MED   jackson-databind 2.17.0 -> 2.18.8
- CVE-2026-42198 MED   postgresql       42.7.2 -> 42.7.11

To keep the Jackson OSGi wiring intact (databind imports
com.fasterxml.jackson.annotation with range [2.18, 3.0)), also bump
jackson-core to 2.18.8 and add a jackson-annotations 2.17.0 -> 2.18.8
replacement step.

Exemptions added to .trivyignore:
- CVE-2026-54515 MED jackson-databind — fix versions 2.18.9 / 2.21.5 are
  not yet released to Maven Central as of 2026-07-02; only 3.1.4 has the
  patch and is a major incompatible bump. Remove after 2.18.9 lands.
- CVE-2026-23901 LOW shiro-core — already backported in the
  1.13.1-alauda fork; Trivy still matches on version string < 2.1.0.

Still open, tracked separately (fork PRs pending):
- CVE-2026-49268 HIGH shiro-core LDAP — AlaudaDevops/shiro#3
- CVE-2026-43827 MED  shiro-core session fixation — AlaudaDevops/shiro#3
- CVE-2026-43828 MED  shiro-web  secure cookie — AlaudaDevops/shiro#3
- CVE-2026-56740 HIGH jline telnet NEW-ENVIRON — AlaudaDevops/jline3#2
- CVE-2026-56741 HIGH jline telnet NAWS — AlaudaDevops/jline3#2

Once those fork releases publish, bump the TODO(sec) markers in
Containerfile and add the corresponding shiro-web / org.jline.jline
replace.sh steps.
@kycheng

kycheng commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/build-testing-base-image

dlcdn.apache.org rotates old Maven versions off the mirror
(3.9.14 was removed after 3.9.16 became latest), which broke
build-testing-base-image with curl exit 22 / HTTP 404.
archive.apache.org keeps all historical versions permanently.
@kycheng

kycheng commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/build-testing-base-image

@kycheng

kycheng commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/integration-test

1 similar comment
@kycheng

kycheng commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/integration-test

@kycheng
kycheng changed the base branch from main to alauda-76.0 July 3, 2026 05:43
@kycheng

kycheng commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/integration-test

@kycheng

kycheng commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

/test nexus-image

…ases

Now that AlaudaDevops/shiro#3 and AlaudaDevops/jline3#2 are merged
and their release workflows have published:
- shiro-core-1.13.2-alauda.jar
- shiro-web-1.13.2-alauda.jar
- jline-3.21.0-alauda.jar

Wire the new jars into the image build so the following CVEs are
actually patched at runtime:

- CVE-2026-49268 (HIGH)   shiro-core LDAP DN injection
- CVE-2026-43827 (MEDIUM) shiro-core session fixation on login
- CVE-2026-43828 (MEDIUM) shiro-web insecure session/rememberMe cookies
- CVE-2026-56741 (HIGH)   jline telnet NAWS DoS
- CVE-2026-56740 (HIGH)   jline telnet NEW-ENVIRON heap DoS

Trivy version-matches by string, so the fork versions still trip its
DB rules even with the fix applied. Extended .trivyignore with the
five CVE/GHSA IDs (plus the pre-existing CVE-2026-23901) documenting
the backport in each case.

Local smoke test: Nexus starts cleanly, HTTP 200 on 8081, 10/10 smoke
tests pass. Trivy re-scan: 0 findings above the ignore list.
@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/build-image

@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/test nexus-image

@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/retest

@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/test-all

@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/build-image

@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/test nexus-image

kycheng added 2 commits July 6, 2026 14:36
Manually built via PipelineRun nexus-image-manual-hqlrf on business-build
cluster (PAC webhook relay gosmee was broken so bypassed it and directly
created the PipelineRun). Image contains the shiro 1.13.2-alauda +
jline 3.21.0-alauda fork jars that clear the remaining 5 CVEs.

Digest: sha256:84c9c91edb0e4e9a82c0185ab29c0fadf3fbdbd4a0dcdd02cd16f271de8a245b
@l-qing

l-qing commented Jul 6, 2026

Copy link
Copy Markdown

/help

2 similar comments
@l-qing

l-qing commented Jul 6, 2026

Copy link
Copy Markdown

/help

@l-qing

l-qing commented Jul 6, 2026

Copy link
Copy Markdown

/help

@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

✅ 手工触发的 build-image + integration-test 均通过

⚠️ 自动触发问题:本 PR 从 2026-07-04 22:52 UTC 起,PAC 的 .tekton/build-image.yaml.tekton/integration-test.yaml 都无法通过 push / /build-image / /test-all / /retest 等命令自动触发。为了不阻塞验证,下面两条流水线是通过在集群 business-build/devops 里直接 kubectl create PipelineRun 绕开 PAC 跑起来的。

手工触发结果

Pipeline Commit 结果 用时 Edge
nexus-image a495c68 ✅ Succeeded (5/5 tasks) ~18min nexus-image-manual-hqlrf
nexus-integration-test 00e779e ✅ Succeeded (13/13 tasks, 2 skipped) ~45min nexus-integration-test-manual-4kv8b
  • 构建出的镜像 tag: build-harbor.alauda.cn/devops/sonatype-nexus3:v3.76.0-ga495c68 (digest sha256:84c9c91e...)
  • 该 tag 已通过 00e779e 写入 chart/values.yaml
  • Trivy 扫描:0 findings above the ignore list
  • 本地 smoke test: 10/10 pass, HTTP 200 on :8081, 无 OSGi 报错

自动触发失效的根因

  • 集群 business-buildpipelines-as-code namespace 里跑着 gosmee client (Deployment gosmee in ns pipelines-as-code),从 https://hook.pipelinesascode.com/<xxx> 拉取 GitHub webhook 转发到 PAC controller
  • gosmee pod 已经 24 天没重启,但长连接从 2026-07-04 22:52 UTC 起断掉(PAC controller / Repository CR 对本 repo 的最后一条事件停在 2026-07-03 14:19
  • 我今天 push 的 3 个新 commit(a495c68 / 00e779e / 一个已 reset 的 empty ping)以及 /build-image/test-all/retest/test nexus-image 等评论触发命令,全都没进 PAC (Repository nexus-build.status.pipelinerun_status 无新条目)
  • kubectl -n pipelines-as-code rollout restart deploy/gosmee 可以恢复,但我本人没有该 namespace 的 patch 权限,暂时用手工 PipelineRun 绕开

排查步骤(供 devops 复现)

# 1. 看该 PR 的最新事件是否进过 PAC
kubectl -n devops get repository nexus-build -o yaml | yq '.status.pipelinerun_status[-3:]'

# 2. 看 gosmee 是否卡住(最后一条日志时间戳应该在几分钟内)
kubectl -n pipelines-as-code logs deploy/gosmee --tail=3

# 3. 卡住就重启
kubectl -n pipelines-as-code rollout restart deploy/gosmee

PR 状态

代码修复、镜像构建、chart tag 更新、集成测试全部就绪。可以 merge。


🤖 Generated with Claude Code

@kycheng

kycheng commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

/ready

@kycheng
kycheng merged commit 4f6a3a5 into AlaudaDevops:alauda-76.0 Jul 6, 2026
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