Prevent shell injection from Tekton task parameters

Abierto
#991 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
azure, shell, yaml

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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:

Lenguaje dominante
Go
Estrellas
26
Forks
41
Merge medio
3 d 14 h
PR fusionados (30 d)
27

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de redhat-developer/mapt

Todos los issues de redhat-developer/mapt

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.