Prevent shell injection from Tekton task parameters

Đang mở
#991 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
azure, shell, yaml
Lĩnh vực
infrastructure, security

Hướng nghiên cứu

Start with tkn/infra-azure-aks.yaml and its template at tkn/template/infra-azure-aks.yaml, then audit the other Tekton tasks and templates across supported platforms for unsafe parameter substitutions and command construction. Trace how values reach shell commands, especially where eval is used, and check the existing task generation and validation setup. Done means malicious and normal parameter values are covered by reproducible validation, create and destroy behavior is preserved, and generated tasks match their templates.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

Tekton substitutes parameter values into task scripts before the shell parses them. In tkn/infra-azure-aks.yaml, parameters such as vmsize, system-pool-vmsize, and workers-desired are inserted directly into shell command text. A value containing shell syntax can execute commands during assignment or when eval runs. The provisioner exports Azure credentials before constructing the command, so injected commands can access those credentials and other resources available to the task.

Required changes

  • Fix parameter handling in tkn/infra-azure-aks.yaml and its template, tkn/template/infra-azure-aks.yaml.
  • Audit other Tekton tasks and templates across supported platforms for the same unsafe substitution and command-construction patterns, and fix affected cases.
  • Pass parameter values as data, not shell source. Prefer direct argument construction without eval; if eval remains, ensure untrusted values cannot be interpreted as shell syntax. Review parameter substitutions outside command construction as well.
  • Preserve existing task behavior and keep generated tasks and templates consistent.

Acceptance criteria

  • Parameter values containing command substitution, quotes, spaces, or shell metacharacters cannot execute commands or alter the intended arguments.
  • Normal create and destroy operations, flags, defaults, and comma-separated VM-size values continue to work.
  • Tests or other reproducible validation cover malicious and normal parameter values for the affected patterns.

Requested by @adrianriobo as a follow-up to:

Ngôn ngữ chính
Go
Star
26
Fork
41
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
27

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của redhat-developer/mapt

Tất cả issue của redhat-developer/mapt

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.