barrierModel arity mismatch: "Expected 4, but was 3" on documented-correct 3-column rows (python-all, javascript-all)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- security
调研方向
首先使用 CLI 2.26.4 和 2.27.0 的 bundle 复现 .github/codeql/extensions/.../models/log-injection.yml 中的失败。阅读 ApiGraphModelsExtensions.qll,并将其中的 barrierModel 签名与文档记录的三列形式以及 python-all/javascript-all packs 进行比较。完成的标准是确认面向用户的有效参数数量,并确定修复应归属于 packs、CLI 验证还是文档。
由索引模型根据 Issue 内容生成。
描述
Summary
CodeQL fatally errors when resolving barrierModel data extensions for codeql/python-all and codeql/javascript-all, on rows that exactly match the documented, correct format (and the format used identically by sourceModel/sinkModel, per github/codeql#21004).
Repro
.github/codeql/extensions/.../models/log-injection.yml:
extensions:
- addsTo:
pack: codeql/python-all
extensible: barrierModel
data:
- ["sciemo_one_client_base.safe_log", "Member[safe_log_value].ReturnValue", "log-injection"]
This is the exact format shown in the official docs (https://codeql.github.com/docs/codeql-language-guides/customizing-library-models-for-python/, "Example: Taint barrier using the 'escape' function") and matches barrierModel(type, path, kind) as formally declared in the Ruby docs' reference section.
Error
A fatal error occurred: A tuple in a data extension for the extensible predicate 'barrierModel' has an incorrect number of columns. Expected 4, but was 3.
What we tried
Assuming a genuine 4-column requirement (the trailing column being QlBuiltins::ExtensionId, per ApiGraphModelsExtensions.qll), we tried supplying a literal 4th value ourselves. None satisfy validation — all fail with:
ERROR: In extension for codeql/python-all:barrierModel, row 1 is invalid. Found '"...", "...", "log-injection", <value>', which does not match the signature 'barrierModel(string type, string path, string kind, [int origin])'.
Tried for <value>:
"manual"(string, matching theprovenanceconvention used elsewhere in MaD, e.g. sourceModel/sinkModel)0(int, repeated across rows)- unique sequential ints per row (
1000,1001,1002)
All fail identically. Per github/codeql#21004, barrierModel's trailing param is QlBuiltins::ExtensionId madId, described as "the data extension row number" — auto-populated internally, never meant to be user-supplied (same as sinkModel/sourceModel, which only ever take 3 user columns). So there appears to be no valid literal a user can write to satisfy the 4-column requirement the arity check enforces.
Versions tried (same failure on both)
- CLI 2.27.0 (codeql-bundle-v2.27.0,
python-all7.2.5 /javascript-all2.10.1, via floatingcodeql-action@v4) - CLI 2.26.4 (codeql-bundle-v2.26.4,
javascript-all/javascript-queries2.4.4, viatools:pinned explicitly to the 2.26.4 bundle asset)
Both hit the identical Expected 4, but was 3 fatal error, and identical rejection of every literal 4th-column value tried.
Why this looks like a real bug, not user error
This is the same failure class as github/codeql-action#2706 (sourceModel arity mismatch, C#, "Expected 10, but was 9"), which was triaged as a genuine bug and fixed upstream, not a documentation/config issue on the reporter's side.
Impact
We currently work around this with continue-on-error: true on the analyze job, which means our repo has had no functioning CodeQL security scanning at all (all languages, not just the one with the custom model) since the analyze step fatally errors before any queries run.
Ask
- Confirm whether
barrierModelgenuinely requires a 4th user-supplied column at these CLI versions, and if so, document the correct literal value for it. - If it should only take 3 columns (matching the documented examples and
sourceModel/sinkModel's pattern), this looks like a packaging/version-skew bug between the compiled query pack and thepython-all/javascript-alllibrary pack.
- 主要语言
- CodeQL
- 星标
- 10.1k
- 派生
- 2.1k
- 平均合并
- 2 天 11 小时
- 30 天内合并 PR
- 129
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/codeql 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
false-positive
难度 2/5 1-3 小时 新手友好度 70/100
-
false-positive
难度 3/5 1-2 天 新手友好度 68/100
相似的 Issue
-
documentation help wanted
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 76/100
AXERA-TECH/ax-llm#75 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
gitbutlerapp/gitbutler#15998 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
sympozium-ai/sympozium#627 ·
-
clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security impact:ux-friction issue-rating: 🦞 diamond lobster P2
难度 2/5 1-3 小时 新手友好度 84/100