Self-hosted: Adding an invalid private key for Bluesky OAuth causes the entire system to crash

(#609) Bug Fixed self-hosting

Summary

When I was setting up the Bluesky OAuth for my self-hosted instance, I had added a private key that the system didn't like and caused the entire system to crash due to a lack of safety checks in src/api/bluesky/BlueskyOAuthService.ts.

Steps to reproduce

  1. Create a new private signed key using openSSL that's not the correct typing for BlueSky's OAuth.
  2. Copy the private key
  3. Paste the private key into the New Private Key field.
  4. Name the key in the New signing key ID field.
  5. Save runtime integrations
  6. Reload any of the Fluxer instance and see it fail to load due to the error from the API container.
Alternatively
  1. Paste any random value into the New Private Key field.
  2. Name the key in the New signing key ID field.
  3. Save runtime integrations
  4. Reload any of the Fluxer instance and see it fail to load due to the error from the API container.

Environment

Docker Version: 29.2.1 Docker Compose Version: 5.0.2 OS: Ubuntu 25.04 x86_64 GNU/Linux Commit: fa3e8525755dae087c03ceaf83b814cbe46c7228

Logs or screenshots

{
    "level": "error",
    "time": "2026-06-16T23:01:59.202Z",
    "service": "errors",
    "env": "production",
    "err": {
        "type": "JwkError",
        "message": "Invalid input",
        "stack": "TypeError: Invalid input
                    at JoseKey.fromImportable (/usr/src/app/fluxer_api/node_modules/.pnpm/@bluesky-social+jwk-jose@0.1.11/node_modules/@bluesky-social/jwk-jose/src/jose-key.ts:191:13)
                    at <anonymous> (/usr/src/app/fluxer_api/src/api/bluesky/BlueskyOAuthService.ts:36:20)
                    at Array.map (<anonymous>)
                    at BlueskyOAuthService.create (/usr/src/app/fluxer_api/src/api/bluesky/BlueskyOAuthService.ts:30:16)
                    at resolveBlueskyOAuthService (/usr/src/app/fluxer_api/src/api/middleware/ServiceRegistry.ts:229:60)
                    at async Object.handler (/usr/src/app/fluxer_api/src/api/middleware/ServiceMiddleware.ts:435:30)
                    at async dispatch (file:///usr/src/app/fluxer_api/node_modules/.pnpm/hono@4.12.2/node_modules/hono/dist/compose.js:22:17)
                    at async handler (file:///usr/src/app/fluxer_api/node_modules/.pnpm/hono@4.12.2/node_modules/hono/dist/hono-base.js:118:39)
                    at async dispatch (file:///usr/src/app/fluxer_api/node_modules/.pnpm/hono@4.12.2/node_modules/hono/dist/compose.js:22:17)
                    at async Object.handler (/usr/src/app/fluxer_api/src/api/middleware/RequireClientIpMiddleware.ts:46:3)",
        "code": "ERR_JWK_INVALID"
    },
    "msg": "Unhandled error occurred"
}

Comments

Sign in with Fluxer to comment and vote.

No comments yet.