Secret should be removed from webhook body by default #4083

Closed
opened 2025-11-02 05:36:57 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @guillep2k on GitHub (Oct 9, 2019).

Gitea version: 1.10.0-dev 3810fa48ac

Since header signatures were introduced in #6428, I think the default behavior should be to remove the secret from the body of the webhook request, as it is exposed in plain text and defeats the purpose of the signature. It's usually not a problem when the connection is https, but many struggle to configure that kind of setup, especially on internal servers that can't get a Letsencrypt certificate.

3810fa48ac/models/webhook.go (L739)

I know this is a breaking change, so I propose an app.ini setting and default it to not include the secret in the body. The admin can change it if they need the old behavior. An ini setting will not be enough if the users need by-repo configuration, though.

Originally created by @guillep2k on GitHub (Oct 9, 2019). Gitea version: 1.10.0-dev 3810fa48ac46620432fbf91571a01eeea0b460b3 Since header signatures were introduced in #6428, I think the default behavior should be to remove the secret from the body of the webhook request, as it is exposed in plain text and defeats the purpose of the signature. It's usually not a problem when the connection is https, but many struggle to configure that kind of setup, especially on internal servers that can't get a Letsencrypt certificate. https://github.com/go-gitea/gitea/blob/3810fa48ac46620432fbf91571a01eeea0b460b3/models/webhook.go#L739 I know this is a breaking change, so I propose an `app.ini` setting and default it to *not* include the secret in the body. The admin can change it if they need the old behavior. An ini setting will not be enough if the users need by-repo configuration, though.
GiteaMirror added the pr/breakingtype/enhancementtopic/security labels 2025-11-02 05:36:57 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4083