Unpinned floating tags (e.g. `v4`) on immutable Actions are not flagged by `actions/unpinned-tag`

Abierto
#22,414 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Área
security

Línea de trabajo

Lee actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql y actions/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll, empezando por isImmutableAction y el predicado SemVer existente. Se considera terminado cuando las etiquetas vX.Y.Z completas y los SHAs completos siguen estando exentos, mientras que se informan las referencias flotantes como vX y vX.Y, con la nota de cambio requerida incluida.

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

Descripción

Description of the issue

The actions/unpinned-tag query (actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql) exempts any Action on the immutable-actions allow list from the unpinned-tag warning, regardless of the ref used. The exclusion is version-independent:

not exists(UsesStep step | uses = step and isImmutableAction(step, nwo))

and isImmutableAction (actions/ql/lib/codeql/actions/security/UseOfUnversionedImmutableAction.qll) only checks membership in immutableActionsDataModel(nwo); it never inspects the version.

Why this is a gap

GitHub's immutability guarantee only applies to fully-expanded SemVer release tags (vX.Y.Z) and full commit SHAs. Floating tags such as v4, v4.0 and main remain mutable: maintainers move them to the latest matching release, so they can change under a consumer exactly like any other tag. See Using immutable releases and tags to manage your action's releases.

As a result, a reference like actions/checkout@v2 is flagged by neither query:

  • UnpinnedActionsTag skips it because actions/checkout is on the immutable list.
  • UnversionedImmutableAction skips it because its isSemVer predicate accepts a bare major tag like v2.

So a genuinely mutable floating tag on an immutable Action goes unwarned.

Suggested direction

Narrow the exemption so an immutable Action is only exempt when pinned to a full vX.Y.Z (or a SHA), for example:

not (isImmutableAction(step, nwo) and isFullSemVer(version))

with an isFullSemVer stricter than the current isSemVer (which also matches floating vX and vX.Y). This would need care because the immutable-action model is shared with the experimental UnversionedImmutableAction query, and it would increase alert volume for consumers pinning immutable Actions to floating major tags, so it deserves its own change note and review.

Filed as a follow-up to #22409 (which is scoped to the trusted-owner allow list and does not address this).

Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 11 h
PR fusionados (30 d)
129

Guía de contribución

Abrir la guía de contribución

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 github/codeql

Todos los issues de github/codeql

Issues similares

Más issues de Security

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.