Skip to content

[cherry-pick: release-v0.37.x] fix(bundle): gate name.Insecure behind --remote-skip-tls (CWE-319) - #3234

Merged
tekton-robot merged 1 commit into
release-v0.37.xfrom
cherry-pick-3200-to-release-v0.37.x
Sep 10, 2026
Merged

[cherry-pick: release-v0.37.x] fix(bundle): gate name.Insecure behind --remote-skip-tls (CWE-319)#3234
tekton-robot merged 1 commit into
release-v0.37.xfrom
cherry-pick-3200-to-release-v0.37.x

Conversation

@tekton-robot

Copy link
Copy Markdown
Contributor

This is a cherry-pick of #3200


Changes

tkn bundle push and tkn bundle list unconditionally passed name.Insecure to every name.ParseReference call, 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:

  • Adding RemoteOptions.NameOptions() []name.Option in pkg/bundle/flags.go — returns []name.Option{name.Insecure} only when --remote-skip-tls is explicitly set, 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.
  • Replacing the hardcoded name.Insecure arguments in push.go (PreRunE + parseArgsAndFlags) and list.go (PreRunE) with NameOptions() calls.
  • Fixing a secondary bug: ToOptions() was mutating http.DefaultTransport in-place. Now uses .Clone() so the global transport is never modified. Uses r.skipTLS instead of literal true for InsecureSkipVerify.
  • Updating the --remote-skip-tls flag description to clarify it also enables plain-HTTP connections, not just cert-check bypass.
  • Regenerating docs and man pages for bundle push and bundle 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:

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

action required: tkn bundle push/list no longer allow plain-HTTP registry connections by default. Pass --remote-skip-tls to opt in to insecure (HTTP) registry access.

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>
@tekton-robot tekton-robot added the release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. label Sep 10, 2026
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 10, 2026
@tekton-robot

Copy link
Copy Markdown
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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 10, 2026
@pratap0007

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 10, 2026
@tekton-robot
tekton-robot merged commit e0bc866 into release-v0.37.x Sep 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants