From 3138cf3a4d3a479c6f19a7d8ceea234ba40cdd5a Mon Sep 17 00:00:00 2001 From: neon <18559658+neonsolstice@users.noreply.github.com> Date: Thu, 14 May 2026 23:37:32 +0000 Subject: [PATCH] fix(security): complete sanitizeLogValue sweep, DOMParser stripHtml, least-privilege CI permissions, pin Dockerfile image --- .github/SECURITY.md | 2 +- .github/workflows/e2e-runner.yml | 3 + .github/workflows/e2e.yml | 9 ++- .github/workflows/release.yml | 7 +-- Dockerfile | 4 +- client/src/assets/main.css | 13 +++++ client/src/features/auth/LoginPage.vue | 8 +-- .../__tests__/useDictionary.test.ts | 57 +++++++++++++++++++ .../reader/epub/composables/useDictionary.ts | 20 +------ ...or-enrichment-orchestrator.service.test.ts | 33 +++++++++++ .../author-enrichment-orchestrator.service.ts | 7 ++- .../authors/author-enrichment.gateway.test.ts | 16 ++++++ .../authors/author-enrichment.gateway.ts | 3 +- .../author-image-storage.service.test.ts | 38 +++++++++++++ .../authors/author-image-storage.service.ts | 5 +- server/src/modules/authors/authors.service.ts | 17 +++--- .../book-metadata-fetch-config.service.ts | 3 +- ...ook-metadata-fetch-orchestrator.service.ts | 9 ++- server/src/modules/book/book.controller.ts | 7 ++- server/src/modules/book/book.service.ts | 29 +++++----- .../modules/collection/collection.service.ts | 3 +- server/src/modules/cover/cover.service.ts | 3 +- .../modules/file-write/file-write.service.ts | 3 +- .../formats/cbx/comic-info-builder.test.ts | 41 +++++++++++++ .../formats/cbx/comic-info-builder.ts | 4 +- .../kobo/services/kobo-proxy.service.ts | 1 + server/src/modules/library/library.service.ts | 3 +- .../metadata-preferences.service.ts | 3 +- .../provider-config.service.ts | 3 +- .../modules/metadata/lib/mobi-parser.test.ts | 10 ++++ .../src/modules/metadata/lib/mobi-parser.ts | 2 +- server/src/modules/metadata/lib/pdf-parser.ts | 3 +- .../src/modules/metadata/metadata.service.ts | 17 +++--- .../migration/migration-progress.gateway.ts | 3 +- .../notification/notification.gateway.ts | 3 +- .../notification/notification.service.test.ts | 7 +++ .../notification/notification.service.ts | 3 +- server/src/modules/scanner/scanner.service.ts | 28 ++++----- 38 files changed, 322 insertions(+), 108 deletions(-) diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 07b5b5484..3fbd00f10 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -2,6 +2,6 @@ ## Reporting a Vulnerability -Use GitHub's [private vulnerability reporting](../../security/advisories/new) to report security issues confidentially. Do not open public issues for security vulnerabilities. +Use GitHub's [private vulnerability reporting](https://github.com/bookorbit/bookorbit/security/advisories/new) to report security issues confidentially. Do not open public issues for security vulnerabilities. I aim to acknowledge reports within a few days and publish a fix as quickly as the severity warrants. diff --git a/.github/workflows/e2e-runner.yml b/.github/workflows/e2e-runner.yml index a540b34e1..21a1d7fe7 100644 --- a/.github/workflows/e2e-runner.yml +++ b/.github/workflows/e2e-runner.yml @@ -43,6 +43,9 @@ jobs: name: ${{ inputs.check-name }} runs-on: ubuntu-latest timeout-minutes: ${{ inputs.job-timeout-minutes }} + permissions: + contents: read + checks: write services: postgres: image: pgvector/pgvector:pg16 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 4ec3e008a..43a94380a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -14,9 +14,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: - contents: read - checks: write +permissions: read-all env: NODE_VERSION: "24" @@ -26,6 +24,8 @@ jobs: name: Build Suite Matrix runs-on: ubuntu-latest timeout-minutes: 5 + permissions: + contents: read outputs: matrix: ${{ steps.build.outputs.matrix }} steps: @@ -48,6 +48,9 @@ jobs: fail-fast: false matrix: suite: ${{ fromJSON(needs.setup.outputs.matrix) }} + permissions: + contents: read + checks: write uses: ./.github/workflows/e2e-runner.yml with: suite-id: ${{ matrix.suite.id }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c98a1993e..4dfef22be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && 'release' || format('pr-{0}', github.event.pull_request.number) }} cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }} -permissions: - actions: read - contents: write - issues: write - pull-requests: write - packages: write +permissions: read-all env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" diff --git a/Dockerfile b/Dockerfile index 11641e60d..f4c248d31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -ARG NODE_IMAGE=node:24.11-alpine +ARG NODE_IMAGE=node:24.11-alpine@sha256:682368d8253e0c3364b803956085c456a612d738bd635926d73fa24db3ce53d7 FROM ${NODE_IMAGE} AS base -RUN npm install -g pnpm@10 +RUN npm install -g pnpm@10.33.4 # Stage 1: Build client FROM base AS client-builder diff --git a/client/src/assets/main.css b/client/src/assets/main.css index a3f2c4253..9cb4a35fd 100644 --- a/client/src/assets/main.css +++ b/client/src/assets/main.css @@ -300,6 +300,19 @@ @apply bg-background text-foreground font-sans antialiased; } + @supports (-webkit-touch-callout: none) { + @media (pointer: coarse) { + /* iOS Safari auto-zooms focused inputs below 16px. Keep editable controls at 16px on touch devices. */ + input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='file']):not([type='button']):not( + [type='submit'] + ):not([type='reset']):not([data-ios-zoom-exempt]), + textarea:not([data-ios-zoom-exempt]), + select:not([data-ios-zoom-exempt]) { + font-size: 16px; + } + } + } + @media (pointer: coarse) { .app-shell-inset, .app-shell-scroll { diff --git a/client/src/features/auth/LoginPage.vue b/client/src/features/auth/LoginPage.vue index 238fa1ed9..23fb5212a 100644 --- a/client/src/features/auth/LoginPage.vue +++ b/client/src/features/auth/LoginPage.vue @@ -104,7 +104,7 @@ async function handleOidcLogin(provider: OidcProviderPublic) {