Skip to content

security: infrastructure & config hardening (5 fixes)#46

Merged
BunsDev merged 10 commits into
mainfrom
consolidate/infra-config
Jun 15, 2026
Merged

security: infrastructure & config hardening (5 fixes)#46
BunsDev merged 10 commits into
mainfrom
consolidate/infra-config

Conversation

@BunsDev

@BunsDev BunsDev commented Jun 15, 2026

Copy link
Copy Markdown
Member

Batches 5 Codex security fixes: config schema, unauthenticated mailpit in docker-compose, Zendesk sidebar API key, and two S3 proxy upload vulnerabilities.

Copilot AI review requested due to automatic review settings June 15, 2026 13:19
@BunsDev BunsDev merged commit 2205997 into main Jun 15, 2026
1 of 3 checks passed
@BunsDev BunsDev deleted the consolidate/infra-config branch June 15, 2026 13:20

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Batches several security and hardening adjustments across storage proxy handling and config parsing to address identified vulnerabilities and improve backward compatibility for managed deployments.

Changes:

  • Adjusts storage proxy response header behavior (inline vs attachment) and updates related tests.
  • Refactors the storage GET handler to be defined inline in the route handler map.
  • Updates config schema discriminator (kind) to accept an additional (rebranded) value and adds a regression test.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/web/src/routes/api/storage/tests/proxy-upload.test.ts Updates expected proxied response Content-Type behavior for active content case.
apps/web/src/routes/api/storage/tests/proxy-get.test.ts Minor formatting changes to mocking setup for presigned GET URL generation.
apps/web/src/routes/api/storage/$.ts Changes proxy header construction + inlines GET handler implementation into route definition.
apps/web/src/lib/server/config-file/schema.ts Expands accepted config kind discriminator values for backward compatibility.
apps/web/src/lib/server/config-file/tests/schema.test.ts Adds coverage for newly accepted config kind value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to 14
const INLINE_PROXY_CONTENT_TYPES = new Set(['image/jpeg', 'image/png', 'image/gif', 'image/webp'])

function isInlineProxyContentType(contentType: string): boolean {
return INLINE_PROXY_CONTENT_TYPES.has(contentType.split(';')[0]?.trim().toLowerCase() ?? '')
}
Comment on lines 21 to 31
export function buildProxyObjectHeaders(key: string, contentType: string): Record<string, string> {
const mediaType = getMediaType(contentType)
const headers: Record<string, string> = {
'Content-Type': contentType,
'Cache-Control': 'public, max-age=31536000, immutable',
'X-Content-Type-Options': 'nosniff',
}

if (SAFE_PROXY_IMAGE_TYPES.has(mediaType)) {
headers['Content-Type'] = contentType
} else {
headers['Content-Type'] = 'application/octet-stream'
if (!isInlineProxyContentType(contentType)) {
headers['Content-Disposition'] = `attachment; filename="${attachmentFilename(key)}"`
headers['Content-Security-Policy'] = 'sandbox'
}
Comment on lines +131 to +135
GET: async ({ request }) => {
const { isS3Configured, generatePresignedGetUrl, getS3Object } =
await import('@/lib/server/storage/s3')
const { config } = await import('@/lib/server/config')

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