[cherry-pick: release-v0.37.x] fix(bundle): gate name.Insecure behind --remote-skip-tls (CWE-319) - #3234
Merged
tekton-robot merged 1 commit intoSep 10, 2026
Conversation
tkn bundle push and tkn bundle list unconditionally passed name.Insecure
to name.ParseReference, enabling plain-HTTP registry connections without
user consent (CWE-319 / ASVS V9.1.1).
Add RemoteOptions.NameOptions() in pkg/bundle/flags.go that returns
[]name.Option{name.Insecure} only when --remote-skip-tls is explicitly
set, and nil otherwise. Validation mode is left to the caller; bundle
push/list prepend name.StrictValidation explicitly to preserve existing
strict-reference behaviour. task start is unchanged.
Also fix a secondary issue in ToOptions(): http.DefaultTransport was
mutated in-place via a type-assertion pointer. Use .Clone() instead to
avoid permanently poisoning the global transport. Set InsecureSkipVerify
to r.skipTLS (variable) rather than a literal true.
Update --remote-skip-tls flag description to clarify it also enables
plain-HTTP connections, not just cert-check bypass. Regenerate docs
and man pages for bundle push and bundle list.
Fixes: SRVKP-13805
Signed-off-by: Divyanshu Agrawal <diagrawa@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
divyansh42
approved these changes
Sep 10, 2026
Contributor
Author
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: divyansh42 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
/lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a cherry-pick of #3200
Changes
tkn bundle pushandtkn bundle listunconditionally passedname.Insecureto everyname.ParseReferencecall, enabling plain-HTTP registry connections without user consent (CWE-319 / ASVS V9.1.1). This creates a MitM risk on untrusted networks.This PR fixes the issue by:
RemoteOptions.NameOptions() []name.Optioninpkg/bundle/flags.go— returns[]name.Option{name.Insecure}only when--remote-skip-tlsis explicitly set,nilotherwise. Validation mode is left to the caller;bundle push/listprependname.StrictValidationexplicitly to preserve existing strict-reference behaviour.task startis unchanged.name.Insecurearguments inpush.go(PreRunE + parseArgsAndFlags) andlist.go(PreRunE) withNameOptions()calls.ToOptions()was mutatinghttp.DefaultTransportin-place. Now uses.Clone()so the global transport is never modified. Usesr.skipTLSinstead of literaltrueforInsecureSkipVerify.--remote-skip-tlsflag description to clarify it also enables plain-HTTP connections, not just cert-check bypass.bundle pushandbundle list.Fixes: https://redhat.atlassian.net/browse/SRVKP-13805
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make checkmake generatedSee the contribution guide
for more details.
Release Notes