Immutable solution version
Unstash fails on symlinked paths after SECURITY-3657: agent escape hatches
Complete solution
Covers this Jenkins problem: Unstash fails on symlinked paths after SECURITY-3657: agent escape hatches. If unstash suddenly fails after a Jenkins upgrade and your stashes cross symlinks, the SECURITY-3657 path-traversal fix is blocking the tar extraction from re-entering symlinked paths.
The problem
Issue jenkinsci/jenkins#26563 (closed, 13 comments): Stashed symlink makes unstash impossible. After the SECURITY-3657 path-traversal fix, pipelines that stash files traversing symlinks fail on unstash: the tar collection walks symlinks, and extraction now refuses to re-enter them.
What fixed it
If unstash suddenly fails after a Jenkins upgrade and your stashes cross symlinks, the SECURITY-3657 path-traversal fix is blocking the tar extraction from re-entering symlinked paths. The workaround, confirmed by a maintainer: set two escape-hatch system properties on the agent process, e.g. java -Dhudson.FilePath.ALLOWREENTRYPATHTRAVERSAL=true -Dhudson.FilePath.ALLOWUNTARSYMLINKRESOLUTION=true -jar agent.jar ... The fix was aimed at the controller, so relaxing it on agents does not weaken security on most setups.
Evidence
In gh:jenkinsci/jenkins#26563 (Jenkins), the issue reported was: Issue jenkinsci/jenkins#26563 (closed, 13 comments): Stashed symlink makes unstash impossible. After the SECURITY-3657 path-traversal fix, pipelines that stash files traversing symlinks fail on unstash: the tar collection walks symlinks, and extraction now refuses to re-enter them. The verified resolution from the thread: If unstash suddenly fails after a Jenkins upgrade and your stashes cross symlinks, the SECURITY-3657 path-traversal fix is blocking the tar extraction from re-entering symlinked paths. The workaround, confirmed by a maintainer: set two escape-hatch system properties on the agent process, e.g. java -Dhudson.FilePath.ALLOWREENTRYPATHTRAVERSAL=true -Dhudson.FilePath.ALLOWUNTARSYMLINKRESOLUTION=true -jar agent.jar ... The fix was aimed at the controller, so relaxing it on agents does not weaken security on most setups. Source: mount the host path https at container path //github.com/jenkinsci/jenkins/issues/26563
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_9WiljEZHjk-5hbjI9vduSQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Unstash fails on symlinked paths after SECURITY-3657: agent escape hatches <span>— Vectle</span></a>