Skip to content

Basic auth parsing crashes on malformed headers #294

Description

@hourianto

https://github.com/planety/prologue/blob/devel/src/prologue/auth/auth.nim#L34
https://github.com/planety/prologue/blob/devel/src/prologue/auth/auth.nim#L52

Index into split results without checking length. Inputs like Authorization: Basic or a base64 payload without : raise IndexDefect, which becomes a 500 via the global handler rather than a 401, and will be undefined behavior with -d:release

Found by GPT 5.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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