-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
csrf required for triggering build via http auth authenticated webhook #4986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
On 2018-12-05 we did a deploy: https://docs.readthedocs.io/en/latest/changelog.html#version-2-8-3 but I don't find anything relevant there. I need to research a little more what has happened here. Also, I got a different error:
|
@humitos thanks - yes I saw that at first to. If you add a "-e" with your URL to the request, it will set a referer. I sort of had 3 steps to get to the csrf error; first it wanted a content-length to be set, then the referer, then it failed with the csrf error |
@humitos did you manage to find anything? |
No yet. I will try to take a look at this soon. Marking this as bug, since it was working properly and also the docs says that it should work properly: https://docs.readthedocs.io/en/latest/webhooks.html#authentication |
@humitos any update on this? I see it's been tagged with a milestone that seems closed, but per http://zuul.openstack.org/builds?job_name=trigger-readthedocs-webhook all our publishing jobs are still failing. If it expected to be fixed, I can look closer and see what's going on (as mentioned before, the logging isn't very helpful as we don't want to leak the password, so I'll have to dig into it more manually). |
@ianw the PR is still under review. I'm pinging @agjohnson here since he had different opinions about this. |
Hello team. Airship project (lives under OpenStack) is affected by this bug. Is there anything I can help with? Thank you. |
This should now be deployed. |
Thank you, it seems our jobs are working again http://zuul.openstack.org/builds?job_name=trigger-readthedocs-webhook |
Uh oh!
There was an error while loading. Please reload this page.
Details
Hi,
In OpenStack, we've been using authentication with the webhook endpoints to trigger builds.
The way this has been working is that projects add a common
openstackci
user as an admin, and then in their project configuration inside our platform they add their webhook URL.When new releases are made, our CI system uses the
openstackci
account (with the password only known to it) to authenticate and trigger RTD builds for the releasing project with a POST. The exact code that does this is https://git.openstack.org/cgit/openstack-infra/zuul-jobs/tree/roles/trigger-readthedocs/tasks/main.yaml#n11But in essence that boils down to (for, say jenkins-job-builder project)
Our jobs starting failing around 2018-12-05 (http://zuul.openstack.org/builds?job_name=trigger-readthedocs-webhook). The jobs don't log the output of this POST so we don't leak the password into logs.
However, testing manually, the responses indicate a content-length is now required, and a referer, which ends up with
So I'm guessing all this points to CSRF has been somehow enabled for webhook endpoints when using HTTP basic-auth? Is this possibly a new configuration?
We don't use the token-based webhook method because this system means we only have one common secret to keep -- the openstackci user password -- and everything else is self-service for projects who simply add the common user as an admin and include in their configuration their endpoint URL.
Any help with this will be greatly appreciated, thanks
The text was updated successfully, but these errors were encountered: