Skip to content

match_body: a secret after a body miss is never swapped #280

Open

Description

@kvdb

swapBody reads the body to EOF. A hit replaces it with a fresh buffer, but a miss leaves the BufferedBody at EOF, and the pipeline only rewinds between transforms. Every later match_body secret in the same transform reads an empty body, and its placeholder goes upstream unchanged.

Repro (v0.49.0, same code on main): three match_body secrets on one host, in the order proxy-username, proxy-notes, proxy-password. POST {"userName":"proxy-username","password":"proxy-password"}. The upstream gets the real username and the literal proxy-password, and the audit's swapped lists only the username secret.

Fix: on a miss, put the bytes that were read back as the body, as the hit path does. PR: #281

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