Actions cache-poisoning query ignores workflow/job cache-mode
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 47/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- github-actions, yaml
- Área
- security, testing-qa
Línea de trabajo
Start with actions/ql/lib/codeql/actions/security/CachePoisoningQuery.qll at the referenced cache-write predicate, then run the supplied CodeQL CLI analysis against the four cache-mode variants to confirm the reported behavior. Trace how workflow and job cache policies are modeled, including the reusable-workflow cases identified in the issue. Done means read-only cases produce no finding while the default and job-write controls still do.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Actions cache-poisoning query ignores workflow/job cache-mode
Description of the false positive
actions/cache-poisoning/poisonable-step reports the same finding whether a job
has read-only or writable cache authority. GitHub documents cache-mode: read
as backend-enforced through scoped cache tokens, preventing cache saves.
I reproduced this with CodeQL CLI 2.27.4, codeql/actions-queries 0.6.39,
and codeql/actions-all 0.7.1 from the checksum-verified Linux bundle.
The query pack's build SHA is
1be292a1e54696ca543b4ad0f9b4537b9687caa7.
Code samples
This is synthetic source. It was extracted and analyzed locally; no workflow,
checkout, or npm command was executed.
name: Cache-mode reproduction
on:
workflow_dispatch:
inputs:
source_sha:
description: Commit to inspect
required: true
type: string
permissions:
contents: read
cache-mode: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ inputs.source_sha }}
- run: npm ci
Four separate source roots differed only in their cache policy:
| Variant | Workflow cache-mode | Job cache-mode | Expected findings | Observed findings |
|---|---|---|---|---|
| read | read | absent | 0 | 1 |
| default | absent | absent | 1 | 1 |
| job-read | absent | read | 0 | 1 |
| job-write | read | write | 1 | 1 |
The write-capable cases are positive controls, assuming the query's threat
model for manually supplied source. A fix must account for job overrides,
rather than suppress every workflow that contains a read-only declaration.
Each result reports:
Potential cache poisoning in the context of the default branch due to
privilege checkout of untrusted code from inputs.source_sha.
(workflow_dispatch).
Commands
Run these for each variant, using separate database and output paths:
codeql database create db-read \
--language=actions --build-mode=none --source-root=fixtures/read
codeql database analyze db-read \
'codeql/[email protected]:Security/CWE-349/CachePoisoningViaPoisonableStep.ql' \
--threads=2 --ram=4096 --format=sarif-latest --output=read.sarif
jq '[.runs[].results[]? |
select(.ruleId == "actions/cache-poisoning/poisonable-step")] | length' \
read.sarif
Relevant model and platform contract
The cache-write predicate considers the triggering event, but does not inspect
explicit workflow/job cache policy:
GitHub's documented policy:
Reusable-workflow caller limits/inheritance should also be covered by a model
fix, but those cases were not included in this minimal executed reproduction.
This report verifies static query behavior; it does not independently test
cache-token enforcement in the backend.
Authored by GitHub Copilot (GPT-6.1 Sol).
- Lenguaje dominante
- CodeQL
- Estrellas
- 10.3k
- Forks
- 2.1k
- Merge medio
- 2 d 6 h
- PR fusionados (30 d)
- 137
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 github/codeql
-
JavaScript externs model StorageEvent() with no type argumentPosiblemente ocupada @asgerf la tomó hace 14 días. Abiertofalse-positive javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
github/codeql#22632 · 3 comentarios · 1 reacción · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
Add AlertSuppression.ql for Rust (inline // codeql[...] suppression)Posiblemente ocupada @cnuss la tomó hace 215 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
github/codeql#21637 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
false-positive
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
github/codeql#21076 · 3 comentarios · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 47/100
Los mantenedores suelen responder en 1 día
-
False positive java/local-variable-is-never-read for Kotlin data object-generated equals temporariesAbiertofalse-positive
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
github/codeql#22987 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de github/codeql
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 71/100
NousResearch/hermes-agent#148792 ·
Los mantenedores suelen responder en 1 día
-
[Bug] adb backup script reports "Done" & exits 0 when the backup failsPosiblemente ocupada @bhattmanthan la tomó hoy. Abiertorequest-issue-assignment
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OWASP/mastg#4034 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Integer overflow → heap out-of-bounds write in `contrib/pngminus/pnm2png.c` via crafted PNM widthAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
Auth: pyric's IdTokenResult uses ISO times and lacks signInSecondFactor, production uses UTC stringsAbiertodivergence lane:reliability
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ansible/ansible-ui#3857 ·
Los mantenedores suelen responder en 1 día