Skip to content

fix: security and infra fixes (#36, #37, #43, #44)#49

Merged
jacaudi merged 6 commits into
mainfrom
feature/security-infra-fixes
Apr 11, 2026
Merged

fix: security and infra fixes (#36, #37, #43, #44)#49
jacaudi merged 6 commits into
mainfrom
feature/security-infra-fixes

Conversation

@jacaudi
Copy link
Copy Markdown
Owner

@jacaudi jacaudi commented Apr 11, 2026

Summary

Four independent fixes from code review of PR #34, bundled together because they're small and share the "security and infra hardening" theme.

Tests added

  • app/tests/test-security-hardening.js — asserts ECDH extractable: false, sanitizeFilename presence and behavior in built output (9 assertions)
  • app/tests/test-infra.js — asserts .dockerignore exists and excludes required paths, asserts Dockerfile pins alpine (7 assertions)

Full suite: 148/148 passing after node scripts/build.js.

Test plan

  • node scripts/build.js && node --test app/tests/test-*.js — all 148 pass
  • Rebased onto current main (dropped old generated app/index.html from pre-refactor commits)
  • CI green (lint-go, lint-config, test-node, test-go, docker-build)
  • Verify Dockerfile still builds with pinned alpine:3

Closes #36
Closes #37
Closes #43
Closes #44

jacaudi and others added 6 commits April 10, 2026 23:37
Both importKey calls in ecdh.js (private key PKCS#8 and public key raw)
used extractable: true with no corresponding exportKey call anywhere in
the codebase. Setting extractable to false prevents key material from
being exported via the Web Crypto API, reducing attack surface.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…#36)

The importEcdhPub function in encryption.js was importing external peer
public keys with extractable: true, making it the most attacker-exposed
ECDH importKey in the codebase. Changed to extractable: false.

Broadened test 3/4 in test-security-hardening.js from a variable-specific
pattern to a generic P-521 namedCurve pattern that catches ALL ECDH
importKey calls regardless of which source file they originate from.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closes #43

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Closes #44

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jacaudi jacaudi merged commit 2b1513b into main Apr 11, 2026
13 checks passed
@jacaudi jacaudi deleted the feature/security-infra-fixes branch April 11, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant