[JENKINS-48012] Require a X-Hub-Signature header when receiving a hook payload and if…#188
[JENKINS-48012] Require a X-Hub-Signature header when receiving a hook payload and if…#188lanwen merged 2 commits intojenkinsci:masterfrom silbernm:JENKINS-48012-require-signature-if-secret-configured
Conversation
… a secret is configured
| * | ||
| * @param config where to remove | ||
| */ | ||
| public static void removeSecretIn(GitHubPluginConfig config) { |
There was a problem hiding this comment.
Javadoc needs to be adjusted then. Currently it says "Checks that an incoming request has a valid signature, if there is specified a signature in the config." which is exactly what the method does.
For discussion: Maybe it worth to add a configuration option which would allow opting-out from enforced checks. I'd guess it's important for on-premise instances like GitHub Enterprise
|
Seems to be introduced by #134:
Versions from v1.21.0 appear to be affected. |
It only checks the signature validity if it's present. For there to be a valid signature, it needs:
So the Javadoc LGTM. |
…ret is specified in the GitHub plugin config
|
@daniel-beck Regarding GitHub Enterprise on-premise: That is exactly the setup that we are using at my workplace. When not configuring a shared secret in the GitHub plugin configuration, the fixed method will continue not to verify the signature, even if one was provided. So we should be fine on that use-case. |
|
… a secret is configured
As reported in JENKINS-48012, an attacker can currently circumvent the signature check of the GitHub plugin simply by omitting the X-Hub-Signature header.
This change is