mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* fix(core): verify SigV4 header signatures for every service under validate-signatures FLOCI_AUTH_VALIDATE_SIGNATURES verified signatures for S3 only, so SQS, KMS, IAM, Scheduler and every other service accepted a request signed with the wrong secret. SigV4HeaderSignatureFilter verifies the Authorization header of every request outside S3 and execute-api when the flag is on, rebuilding the canonical request from the request as it arrived and answering in the protocol the request used. Unsigned requests are left alone, and the default configuration is unchanged. The filter runs after matching so it can hash the body. The SQS queue-URL router now records the bytes it appends to a Query body, and the CBOR content type is read from the header that preserves it, so neither rewrite breaks a valid signature. With the flag on, an unknown or synthetic access key is now refused by every service, as S3 already refused it. Closes #5195 * fix(core): skip signature checks by matched resource, strip the spoofable content-type header The filter skipped any request whose credential scope named s3 or execute-api, so a caller could sign an SQS or KMS call under either and pass with the wrong secret, and S3 Control was never checked. It now steps aside only for the resources another verifier owns: S3Controller and the API Gateway execute controllers. AwsCborContentTypeFilter removes any client-sent X-Floci-Original-Content-Type, so a signed Content-Type cannot be swapped behind a forged copy. REST-XML services (Route 53, CloudFront, S3 Control) get XML errors. Header and scope parsing reuse SigV4AuthorizationHeader and CredentialScope, and the canonical request moves into SigV4Canonicalization, shared with ExecuteApiSigV4Authorizer. * fix(core): leave AppSync GraphQL signatures to AppSync's own check AppSync's GraphQL endpoint verifies IAM signatures itself and answers a failure with the UnauthorizedException envelope AppSync clients parse. With validate-signatures on, the header filter reached it first and answered with a JSON InvalidSignatureException. AppSyncExecutionController joins the resources the filter steps aside for.