[Low] CSI plugin builds staging directories from storage_volume_id without a containment check
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Lee internal/volume/csi/plugin.go en los puntos donde stageVolume y unstageVolume construyen rutas; después, comprueba cómo resources.ValidateStorageVolumeID valida los ID. Añade cobertura para ../x y a/b en la prueba unitaria pertinente y verifica que ninguna de las dos operaciones de staging acceda a rutas fuera del prefijo de staging.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
stageVolume and unstageVolume in the CSI volume plugin build the staging path as filepath.Join(p.stagingDirPrefix, volumeID), then MkdirAll and later remove it. storage_volume_id is only checked for control characters and length, so a value containing / or .. would resolve outside stagingDirPrefix. The ID comes from the CSI provisioner and control plane, not from tenants, so this is defense in depth.
Details
internal/volume/csi/plugin.go#L296-L299:
stagingPath := filepath.Join(p.stagingDirPrefix, req.VolumeID)
if err := os.MkdirAll(stagingPath, 0750); err != nil {
return "", fmt.Errorf("failed to create staging directory %q: %w", stagingPath, err)
}
#L344: stagingPath := filepath.Join(p.stagingDirPrefix, volumeID) (unstage, followed by removal of the staging dir).
storage_volume_id (pkg/proto/ateapipb/ateapi.proto#L507-L519) is "the storage system's own" format, validated only by resources.ValidateStorageVolumeID (control characters).
Impact
Low: the value is set by the provisioner when it creates the volume, not by an actor or template. A misbehaving or compromised CSI driver could return an ID that makes atelet create or remove directories outside the staging prefix on the node.
Suggested fix
Derive the staging directory from a hash of the volume ID (as kubelet does) instead of the raw ID, or reject IDs where !filepath.IsLocal(id). Add a unit test with ../x and a/b.
- Lenguaje dominante
- Go
- Estrellas
- 5.7k
- Forks
- 612
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 562
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de agent-substrate/substrate
-
area/security kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agent-substrate/substrate#2932 ·
Los mantenedores suelen responder en 1 día
-
[Low] guestVolumeSource can map host paths containing ".." outside the microVM guest sharePosiblemente ocupada @jiayimeow la tomó hace 2 días. Abiertoarea/security kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
agent-substrate/substrate#2920 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Low] setupImageVolumes builds host mount paths from vol.Name without a containment checkPosiblemente ocupada @abhisheksharma2411 la tomó hace 1 día. Abiertoarea/security kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
agent-substrate/substrate#2919 ·
Los mantenedores suelen responder en 1 día
-
[Low] ate-api-server accepts client certificates chained to system roots when --pod-identity-ca-certs is unsetPosiblemente ocupada @abhisheksharma2411 la tomó hace 1 día. Abiertoarea/security kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
agent-substrate/substrate#2918 ·
Los mantenedores suelen responder en 1 día
-
Cloud SQL backend: document (and optionally provision) Private Service Connect for ATE_API_POSTGRES_CLOUDSQL_IP_TYPE=pscPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea/dev-infra kind/docs kind/feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
agent-substrate/substrate#2875 ·
Los mantenedores suelen responder en 1 día
Todos los issues de agent-substrate/substrate
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
docker/sbx-releases#737 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
area/manager needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
kyma-project/telemetry-manager#3922 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
JakeChampion/lang#12965 ·
Los mantenedores suelen responder en 1 día
-
hacktoberfest priority: low skill: good first issue status: ready for dev
Dificultad 2/5 1-3 horas Aptitud para principiantes 89/100
hyperledger-labs/fabric-smart-client#2218 ·
Los mantenedores suelen responder en 1 día