Actions cache-poisoning query ignores workflow/job cache-mode
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 47/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github-actions, yaml
- 領域
- security, testing-qa
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- CodeQL
- スター
- 10.3k
- フォーク
- 2.1k
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 137
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/codeql のほかの issue
-
JavaScript externs model StorageEvent() with no type argument対応中かも @asgerf が 14 日前に担当しました。 オープンfalse-positive javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/codeql#22632 · コメント 3 件 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
Add AlertSuppression.ql for Rust (inline // codeql[...] suppression)対応中かも @cnuss が 215 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/codeql#21637 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
false-positive
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
github/codeql#21076 · コメント 3 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
メンテナーはふだん 1 日以内に返信
-
False positive java/local-variable-is-never-read for Kotlin data object-generated equals temporariesオープンfalse-positive
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
github/codeql#22987 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
NousResearch/hermes-agent#148792 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] adb backup script reports "Done" & exits 0 when the backup fails対応中かも @bhattmanthan が今日担当しました。 オープンrequest-issue-assignment
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Integer overflow → heap out-of-bounds write in `contrib/pngminus/pnm2png.c` via crafted PNM widthオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 4 日以内に返信
-
Auth: pyric's IdTokenResult uses ISO times and lacks signInSecondFactor, production uses UTC stringsオープンdivergence lane:reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ansible/ansible-ui#3857 ·
メンテナーはふだん 1 日以内に返信