# pull: true silently falls back to cached image when registry authentication fails
#5920
Unanswered
Terracast-cmd
asked this question in
Ask a Question
Replies: 1 comment
|
There is a separate error handling for this case in the code already: https://github.com/woodpecker-ci/woodpecker/blob/main/pipeline/backend/docker/docker.go#L200-L204 Seems that it does not work then though… |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
pull: truesilently falls back to cached image when registry authentication failsComponent
agent
Describe the bug
When using
pull: trueon a step with a private registry image, if the agent doesn't have valid credentials configured for that repository but the image exists in the local Docker cache (pulled previously by another repository's pipeline that had valid credentials), the step succeeds silently instead of failing with an authentication error.This is a security concern because:
registry.example.com/image:latest→ image is now cached on the agentpull: trueThe
pull: trueoption should enforce authentication with the registry, not silently fall back to cached images when auth fails.Steps to reproduce
pull: true:Expected behavior: Pipeline fails with
authorization failed: no basic auth credentialsActual behavior: Pipeline succeeds, silently using the cached image
Additional context
I initially noticed that repositories without registry credentials could use private images if they were already cached on the agent (pulled by other repositories with valid credentials). I tried using
pull: trueas a workaround to force credential validation on every pull, but discovered that it silently falls back to the cached image when authentication fails.This behavior breaks the isolation model between repositories. The
pull: trueoption is documented as:The current behavior means:
pull: truedoes not guarantee that valid credentials exist for the registrySuggested fix
When
pull: trueis set, Woodpecker should fail the step if the pull operation fails for any reason (including authentication), rather than falling back to a cached image.Alternatively, if fallback is intentional, it should be:
pull: always-authorpull: strictEnvironment
woodpeckerci/woodpecker-server:v3)woodpeckerci/woodpecker-agent:v3)Note
I've only been using Woodpecker for a few months, so I may have missed something in my configuration. If this is expected behavior or a misconfiguration on my part, I'd appreciate any guidance. However, after checking the documentation and my setup thoroughly, I couldn't find any explanation for this behavior.
Related
This is related to the broader question of image cache isolation between repositories on shared agents, but this specific issue is about
pull: truenot behaving as expected.All reactions