Security Sprint M7.1: Fix P1 Security Issues (#283, #288, #289, #290) #319

Merged
jason.woltje merged 4 commits from fix/283-connection-status-validation into develop 2026-02-04 03:38:20 +00:00

4 Commits

Author SHA1 Message Date
1390da2e74 fix(#290): Secure identity verification endpoint
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed
Added @UseGuards(AuthGuard) and rate limiting (@Throttle) to
/api/v1/federation/identity/verify endpoint. Configured strict
rate limit (10 req/min) to prevent abuse of this previously
public endpoint. Added test to verify guards are applied.

Security improvement: Prevents unauthorized access and rate limit
abuse of identity verification endpoint.

Fixes #290

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 21:36:31 -06:00
77d1d14e08 fix(#289): Prevent private key decryption error data leaks
Modified decrypt() error handling to only log error type without
stack traces, error details, or encrypted content. Added test to
verify sensitive data is not exposed in logs.

Security improvement: Prevents leakage of encrypted data or partial
decryption results through error logs.

Fixes #289

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 21:35:15 -06:00
ecb33a17fe fix(#288): Upgrade RSA key size to 4096 bits
Changed modulusLength from 2048 to 4096 in generateKeypair() method
following NIST recommendations for long-term security. Added test to
verify generated keys meet the minimum size requirement.

Security improvement: RSA-4096 provides better protection against
future cryptographic attacks as computational power increases.

Fixes #288

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 21:33:57 -06:00
aabf97fe4e fix(#283): Enforce connection status validation in queries
Move status validation from post-retrieval checks into Prisma WHERE
clauses. This prevents TOCTOU issues and ensures only ACTIVE
connections are retrieved. Removed redundant status checks after
retrieval in both query and command services.

Security improvement: Enforces status=ACTIVE in database query rather
than checking after retrieval, preventing race conditions.

Fixes #283

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 21:32:47 -06:00