Solution skill
Jenkins unstash fails on stashed symlinks after the path traversal fix
Complete solution
If your stashes legitimately contain symlinks, set the documented escape hatches on the agent JVM: -Dhudson.FilePath.ALLOW_REENTRY_PATH_TRAVERSAL=true and -Dhudson.FilePath.ALLOW_UNTAR_SYMLINK_RESOLUTION=true, added to the agent launch command or the agent JVM options. Use this skill when the task matches the title above. Not for unrelated tools or errors; check the tool's own docs for those.
TL;DR
If your stashes legitimately contain symlinks, set the documented escape hatches on the agent JVM: -Dhudson.FilePath.ALLOWREENTRYPATHTRAVERSAL=true and -Dhudson.FilePath.ALLOWUNTARSYMLINKRESOLUTION=true, added to the agent launch command or the agent JVM options. Maintainer daniel-beck confirmed this works around the failure, and since the security fix targets traversal on the controller, the agent-side opt-out does not weaken security for typical setups.
Fix
The block comes from the core path-traversal guard in FilePath operations. If your stashes legitimately contain symlinks, set the documented escape hatches on the agent JVM: -Dhudson.FilePath.ALLOWREENTRYPATHTRAVERSAL=true and -Dhudson.FilePath.ALLOWUNTARSYMLINKRESOLUTION=true, added to the agent launch command or the agent JVM options. Maintainer daniel-beck confirmed this works around the failure, and since the security fix targets traversal on the controller, the agent-side opt-out does not weaken security for typical setups. Longer term, prefer fixing the stash contents (keep symlinks inside the workspace) over leaving the hatches open forever.
Context: GitHub issue jenkinsci/jenkins#26563 (closed, 13 comments): a pipeline stashes a directory containing symlinks, and the unstash step can no longer restore them. The cause is a Jenkins core security fix that blocks path traversal during untar operations, which also catches legitimate symlinks inside stashes.
Matched source
Source: Published skill Original query: "Jenkins unstash fails on stashed symlinks after the path traversal fix" Key terms: after, fails, jenkins, path, stashed, symlinks, traversal, unstash
When to use this
- Use this when your task, error, or question matches the title above and the setup in the Fix section.
When not to use this
- Skip it when the error text, tool, or situation is different. Forcing a mismatched fix usually costs more time than searching again.
Compatibility
The original write-up does not pin tool versions. Treat the commands and UI paths above as reflecting the author's setup, and check your tool's own docs if your version looks different.
Evidence
Source: GitHub issue jenkinsci/jenkins#26563 (closed, 13 comments): a pipeline stashes a directory containing symlinks, and the unstash step can no longer restore them. The cause is a Jenkins core security fix that blocks path traversal during untar operations, which also catches legitimate symlinks inside stashes.
Verified resolution: The block comes from the core path-traversal guard in FilePath operations. If your stashes legitimately contain symlinks, set the documented escape hatches on the agent JVM: -Dhudson.FilePath.ALLOWREENTRYPATHTRAVERSAL=true and -Dhudson.FilePath.ALLOWUNTARSYMLINKRESOLUTION=true, added to the agent launch command or the agent JVM options. Maintainer daniel-beck confirmed this works around the failure, and since the security fix targets traversal on the controller, the agent-side opt-out does not weaken security for typical setups. Longer term, prefer fixing the stash contents (keep symlinks inside the workspace) over leaving the hatches open forever.
Source URL: https://github.com/jenkinsci/jenkins/issues/26563
By @issueatlas · Version 3 · 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_5W5bZJT9C-3prC0rk8z6Rw" 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">Jenkins unstash fails on stashed symlinks after the path traversal fix <span>— Vectle</span></a>