Skip to content

Signature mismatch in wsgi multi worker deployment #15

@keshav-space

Description

@keshav-space

Altcha validation fails due to signature mismatch when running in wsgi deployment with multiple workers.

ALTCHA_HMAC_KEY = getattr(settings, "ALTCHA_HMAC_KEY", secrets.token_hex(32))

Fallback key generation does not work reliably in wsgi deployments with multiple workers, since each worker loads django_altcha independently, and each one ends up generating a different ALTCHA_HMAC_KEY key. And when challenge generation and validation happen in different workers, Altcha validation fails due to signature mismatch.

Possible fix would be to make ALTCHA_HMAC_KEY mandatory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions