-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.492.1
Bitbucket Server Integration Plugin 4.1.4
Bitbucket Server v7.21.6
The build now action in Bitbucket (see below) can't be initiated in Bitbucket Server Integration Plugin 4.1.4.
I believe this is because version 4.1.4 fixes Jenkins Security Advisory 2025-01-22. However, CSRF protection is not disabled for this URL.
Jenkins responds with the following:
Bitbucket doesn't have access to the crumb generated by Jenkins in the Jenkins user's session and therefore can't provide it in the Jenkins-Crumb header.
Rolling back the plugin to version 4.1.3 fixes this issue, but doesn't include the security fixes from 4.1.4
The build now button seems to only work for freestyle jobs. In my case, I am trying to build a multibranch pipeline job.
I believe it is because of the following code in src/main/java/com/atlassian/bitbucket/jenkins/internal/applink/oauth/serviceprovider/rest/OauthCrumbExclusion.java:
This only returns a list of build URL's for freestyle projects because of Project.class
org.jenkinsci.plugins.workflow.job.WorkflowJob.class however will work for other types of projects.
Therefore, since my multibranch pipeline build URL is not in this list, the URL doesn't get a CSRF protection exemption like it should.