Repository navigation
[JENKINS-42556] PlaceholderTask.runForDisplay vulnerable to AccessDeniedException #21917
Copy link
Copy link
Closed
Closed
Copy link
Description
Resuming build at ... after Jenkins restart [Pipeline] End of Pipeline java.io.IOException: Failed to load build state at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:610) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:608) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:651) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35) at ... Caused by: org.acegisecurity.AccessDeniedException: Please login to access job ... at jenkins.model.Jenkins.getItem(Jenkins.java:2724) at jenkins.model.Jenkins.getItem(Jenkins.java:324) at jenkins.model.Jenkins.getItemByFullName(Jenkins.java:2830) at hudson.model.Run.fromExternalizableId(Run.java:2314) at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.runForDisplay(ExecutorStepExecution.java:385) at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.getDisplayName(ExecutorStepExecution.java:398) at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.getFullDisplayName(ExecutorStepExecution.java:407) at org.jenkinsci.plugins.workflow.support.pickles.ExecutorPickle$1.printWaitingMessage(ExecutorPickle.java:116) at org.jenkinsci.plugins.workflow.support.pickles.TryRepeatedly$1.run(TryRepeatedly.java:95) at ...
Presumably there is no anonymous read access, and the Timer thread used by TryRepeatedly neglected to impersonate SYSTEM.
Originally reported by
jglick, imported from: PlaceholderTask.runForDisplay vulnerable to AccessDeniedException
- assignee:
jglick
- status: Resolved
- priority: Major
- component(s): core, workflow-durable-task-step-plugin
- resolution: Fixed
- resolved: 2017-03-10T00:34:24+00:00
- votes: 0
- watchers: 2
- imported: 2025-11-24
Raw content of original issue
Resuming build at ... after Jenkins restart [Pipeline] End of Pipeline java.io.IOException: Failed to load build state at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:610) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$3.onSuccess(CpsFlowExecution.java:608) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:651) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35) at ... Caused by: org.acegisecurity.AccessDeniedException: Please login to access job ... at jenkins.model.Jenkins.getItem(Jenkins.java:2724) at jenkins.model.Jenkins.getItem(Jenkins.java:324) at jenkins.model.Jenkins.getItemByFullName(Jenkins.java:2830) at hudson.model.Run.fromExternalizableId(Run.java:2314) at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.runForDisplay(ExecutorStepExecution.java:385) at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.getDisplayName(ExecutorStepExecution.java:398) at org.jenkinsci.plugins.workflow.support.steps.ExecutorStepExecution$PlaceholderTask.getFullDisplayName(ExecutorStepExecution.java:407) at org.jenkinsci.plugins.workflow.support.pickles.ExecutorPickle$1.printWaitingMessage(ExecutorPickle.java:116) at org.jenkinsci.plugins.workflow.support.pickles.TryRepeatedly$1.run(TryRepeatedly.java:95) at ...Presumably there is no anonymous read access, and the Timer thread used by TryRepeatedly neglected to impersonate SYSTEM.
Reactions are currently unavailable
Activity
jenkins-infra-bot commentedon Mar 7, 2017
Remote links associated with this issue:
jenkins-infra-bot commentedon Mar 8, 2017
Raw content of original comment:
Or rather anonymous DISCOVER access but not READ, an unusual configuration. Reproducible, though see
JENKINS-42577for why reproducing can be tricky.Perhaps core should impersonate SYSTEM in Timer threads automatically, since this is hardly the first time such a bug has occurred.
jenkins-infra-bot commentedon Mar 9, 2017
Raw content of original comment:
After some back and forth I have decided that while TryRepeatedly shares some blame, a fix there does not necessarily suffice, because Queue.Task.getFullDisplayName can be called from other threads.
jenkins-infra-bot commentedon Mar 11, 2017
Raw content of original comment:
Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/hudson/model/Queue.java
http://jenkins-ci.org/commit/jenkins/0bb69952f715ea80b92285b3a810fb938561e594
Log:
JENKINS-42556Improved logging for Queue.jenkins-infra-bot commentedon Mar 11, 2017
Raw content of original comment:
Code changed in jenkins
User: Daniel Beck
Path:
core/src/main/java/hudson/model/Queue.java
http://jenkins-ci.org/commit/jenkins/13d85fb805161a94e45d4ac485fb3a84d2c72e1a
Log:
Merge pull request #2791 from jglick/Queue-logging-
JENKINS-42556JENKINS-42556Improved logging for QueueCompare: ea724ab...13d85fb
jenkins-infra-bot commentedon Mar 14, 2017
Raw content of original comment:
Code changed in jenkins
User: Jesse Glick
Path:
src/main/java/org/jenkinsci/plugins/workflow/support/pickles/TryRepeatedly.java
http://jenkins-ci.org/commit/workflow-support-plugin/3c076a7c93717ee7d819eeda82dd91f1be099bde
Log:
JENKINS-42556Handle runtime exceptions from printWaitingMessage.jenkins-infra-bot commentedon Mar 14, 2017
Raw content of original comment:
Code changed in jenkins
User: Jesse Glick
Path:
src/main/java/org/jenkinsci/plugins/workflow/support/pickles/TryRepeatedly.java
http://jenkins-ci.org/commit/workflow-support-plugin/494446bf5962ff41726818224312079876c2cc70
Log:
Merge pull request #32 from jglick/TryRepeatedly-anonDiscover-
JENKINS-42556JENKINS-42556Handle runtime exceptions from printWaitingMessageCompare: jenkinsci/workflow-support-plugin@6fce277...494446b
jenkins-infra-bot commentedon Mar 14, 2017
Raw content of original comment:
Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/jenkins/security/ImpersonatingExecutorService.java
core/src/main/java/jenkins/security/ImpersonatingScheduledExecutorService.java
core/src/main/java/jenkins/util/AtmostOneTaskExecutor.java
core/src/main/java/jenkins/util/InterceptingScheduledExecutorService.java
core/src/main/java/jenkins/util/Timer.java
http://jenkins-ci.org/commit/jenkins/3f41d563b2d619d892e483055cc3d8f511d11dc1
Log:
JENKINS-42556Run more system threads as SYSTEM.jenkins-infra-bot commentedon Mar 14, 2017
Raw content of original comment:
Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/jenkins/security/ImpersonatingExecutorService.java
core/src/main/java/jenkins/security/ImpersonatingScheduledExecutorService.java
core/src/main/java/jenkins/util/AtmostOneTaskExecutor.java
core/src/main/java/jenkins/util/InterceptingScheduledExecutorService.java
core/src/main/java/jenkins/util/Timer.java
http://jenkins-ci.org/commit/jenkins/dd0d578cb07084366ab4d1a1efdeb1fe39d14688
Log:
Merge pull request #2792 from jglick/SYSTEM-
JENKINS-42556JENKINS-42556Run more system threads as SYSTEMCompare: 12a4177...dd0d578
jenkins-infra-bot commentedon Mar 14, 2017
Raw content of original comment:
Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/jenkins/security/ImpersonatingExecutorService.java
core/src/main/java/jenkins/security/ImpersonatingScheduledExecutorService.java
core/src/main/java/jenkins/util/InterceptingScheduledExecutorService.java
http://jenkins-ci.org/commit/jenkins/98bb78ff1891bb85471a089977066c4b4a11b261
Log:
JENKINS-42556Updating since tags for #2792.jenkins-infra-bot commentedon Apr 12, 2017
Raw content of original comment:
jglick Is this a useful LTS candidate?
jenkins-infra-bot commentedon Apr 12, 2017
Raw content of original comment:
Well…it is relatively risky, and this particular bug symptom has an independent workaround, so I am not sure I would recommend it for backport.
jenkins-infra-bot commentedon Apr 12, 2017
Raw content of original comment:
Not an LTS candidate then.
jenkins-infra-bot commentedon Sep 28, 2017
Raw content of original comment:
Found another effect of this. On 2.46.x (prior to this fix), a Pipeline virtual thread dump like /job/…/…/threadDump/ will show, e.g.,
when there is a node block waiting in queue but the system has no anonymous read access. This is because ExecutorStepExecution.getStatus checks Queue.getItems, which as of SECURITY-186 is a permission-controlled call, which would in fact work if called under the authentication of the user looking at the thread dump (who presumably has READ on that job); yet StepExecution.getStatusBounded runs inside Timer, thus as anonymous.
jenkins-infra-bot commentedon Nov 24, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-42504]jenkins-infra-bot commentedon Nov 24, 2025
[Original
relates_tofrom Jira: JENKINS-42707]jenkins-infra-bot commentedon Nov 24, 2025
[Original
relates_tofrom Jira: JENKINS-63868]jenkins-infra-bot commentedon Nov 24, 2025
[Original
relates_tofrom Jira: JENKINS-50296]jenkins-infra-bot commentedon Nov 24, 2025
[Original
epicfrom Jira: JENKINS-35399]