Skip to content

chore(sensitive): Immich's Postgres to 17-vectorchord1.1.1, from a build that had aged to 20 critical CVEs (#980) - #1061

Closed
Gerrrt wants to merge 1 commit into
mainfrom
gerrrt/immich-db-vectorchord-980
Closed

Gerrrt wants to merge 1 commit into
mainfrom
gerrrt/immich-db-vectorchord-980

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Refs #980. That issue stays open after this merges. The weekly CVE scan shuts it on its own once the pinned digest scans clean, and this one does not yet. See below.

Why

ghcr.io/immich-app/postgres:17-vectorchord0.4.3 was built on 2025-10-07, on Debian 12.11, and upstream has never rebuilt that tag. Its digest today is still the one pinned. Dependabot offered nothing, because it reads 17-vectorchord0.4.3 and 17-vectorchord1.1.1 as unrelated tags.

Scanned with the repository's pinned trivy (0.75.0), HIGH/CRITICAL fixable findings only:

Tag Debian Built Critical High
17-vectorchord0.4.3 (was pinned) 12.11 2025-10-07 20 119
17-vectorchord0.5.3 12.13 2026-06-23 17 63
17-vectorchord1.1.1 (now pinned) 12.14 2026-10-06 13 41

What remains in 1.1.1: perl (three CVEs across perl, perl-base, libperl5.36 and perl-modules-5.36), and gosu's Go runtime (stdlib 1.24.6). gosu is the entrypoint's privilege drop, used once at start. There is no fixed upstream build yet, so the issue stays open.

What changes

stacks/sensitive/compose.yaml, immich-db: the image pin, and a comment recording why it moves by hand. Postgres stays at 17. Only the VectorChord extension moves, from 0.4.3 to 1.1.1. The hardening is unchanged.

Immich handles the extension. v3.2.4 accepts VectorChord >=0.3 <2 (server/src/constants.ts). At start, database.repository.ts runs ALTER EXTENSION vchord UPDATE TO the image's version, then reindexes the CLIP and face vector indexes.

Tested

The upgrade was run on throwaway containers under this block's exact hardening: user 999, read-only root, cap_drop: ALL, no-new-privileges, the same three tmpfs mounts, and --network none.

  1. On 0.4.3: CREATE EXTENSION vchord, 500 rows, and a vchordrq cosine index.
  2. Restarted on 1.1.1 with the same volume. It offered vchord 1.1.1, with 0.4.3 installed.
  3. ALTER EXTENSION vchord UPDATE TO '1.1.1'.
  4. REINDEX, and an index-forced nearest-neighbour query returned 5 rows. The container logs were clean.

The live sensitive-immich-db was not touched, and it stayed healthy throughout. yamllint, check_image_pins.py and check_docs.py pass.

Deploy (operator, on trinity)

  • Take a make backup set that includes immich-db first. It is the restore point if the extension upgrade misbehaves on the real library.
  • make up STACK=sensitive. On first start, expect Immich's log to show the vchord update and a reindex of the CLIP and face indexes. On the real library this can take minutes.
  • Check that Immich's smart search and face grouping both answer.
  • The next Monday's CVE scan should rewrite the issue to the 13/41 picture.

🤖 Generated with Claude Code

…ild that had aged to 20 critical CVEs (#980)

The pinned ghcr.io/immich-app/postgres:17-vectorchord0.4.3 was built on
2025-10-07, on Debian 12.11. Upstream never rebuilt that tag, and the
weekly CVE scan found 20 critical and 119 high fixable findings in it.
Dependabot offered nothing: it read 17-vectorchord0.4.3 and
17-vectorchord1.1.1 as unrelated tags.

17-vectorchord1.1.1 was built on 2026-10-06, on Debian 12.14. Scanned with
the pinned trivy, it has 13 critical and 41 high. What remains is perl
(three CVEs across four packages) and gosu's Go runtime, with no fixed
upstream build yet, so #980 stays open for the scan to close.

Postgres stays at 17. The extension moves from VectorChord 0.4.3 to 1.1.1,
which is inside Immich v3.2.4's supported range (>=0.3 <2,
server/src/constants.ts). At start, Immich runs ALTER EXTENSION vchord
UPDATE TO the image's version, then reindexes the CLIP and face indexes.

That path was run on throwaway containers under this block's exact
hardening (user 999, read-only root, cap_drop ALL, the same tmpfs mounts,
no network):
- a 0.4.3 database with a vchordrq index and 500 rows;
- restarted on 1.1.1;
- ALTER EXTENSION to 1.1.1;
- REINDEX, and an index-forced nearest-neighbour query returned 5 rows.
The logs were clean. The live sensitive-immich-db was not touched.

Refs #980

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 23:08

Copilot AI 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.

🟡 Changes recommended

The upgrade contradicts the linked issue’s recorded decision to wait without explicitly superseding it.

1 open finding
What changed in this PR

Updates Immich’s PostgreSQL image to reduce known critical and high-severity CVEs while retaining PostgreSQL 17.

Changes:

  • Upgrades VectorChord from 0.4.3 to 1.1.1.
  • Documents compatibility, testing, and manual update rationale.
File Description
stacks/​sensitive/​compose.yaml Updates the database image pin and supporting rationale.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread stacks/sensitive/compose.yaml Resolved
@Gerrrt

Gerrrt commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Closed unmerged in favour of #980's recorded decision: wait until Immich's own compose moves past VectorChord 0.4.3. v3.3.0 still ships 0.4.3. The tested upgrade path is recorded on #980 for when it does.

@Gerrrt
Gerrrt deleted the gerrrt/immich-db-vectorchord-980 branch October 9, 2026 03:31
This pull request was closed.
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