chore(H2): baseline security gate #43
No reviewers
Labels
No labels
idea
points
1
points
13
points
2
points
3
points
5
points
8
priority
p0
priority
p1
priority
p2
priority
p3
state
blocked
state
done
state
in-progress
state
ready
state
review
state
triage
status
declined
status
in-progress
status
planned
status
proposed
status
shipped
status
under-review
type
bug
type
epic
type
feature
type
spike
type
story
type
task
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
tti/tti-ux!43
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/h2-baseline-security"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seeds the Area H baseline SCA + secret-scan + report-only semgrep SAST gate. After merge, mark baseline-security a required status check.
AI review · advisory
Verdict: 1 thing worth fixing (1 medium).
⚑ panel: GPT-OSS 120B · Gemma 4 31B · Devstral 2 123B · Laguna S 2.1 — 2 distinct, 1 confirmed, 1 refuted · web: not used · context: 1 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Panel debate — how this review was reached
Grounding — context: 1 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Round 1 — independent reviews
Round 2 — cross-examination
Devstral 2 123B#1Incorrect regex pattern for AWS access key ID detection · confirmed: — · refuted: GPT-OSS 120B, Gemma 4 31B, Laguna S 2.1Gemma 4 31B#1Inconsistent security rule baseline · confirmed: GPT-OSS 120B, Devstral 2 123B, Laguna S 2.1 · refuted: —Raised but refuted (left out of the review above)
Devstral 2 123B#1Incorrect regex pattern for AWS access key ID detection — The evidence shows the regex uses a negative lookbehind for the literal stringX-Amz-Credential=exactly as described in the change comment. The comSynthesis — Devstral 2 123B wrote the final review from 1 confirmed finding.
Transcript
rv-20260818165100-1751f7— full round outputs, web results, and model reasoning are viewable by anyone with access to this repository via the AI gateway.Advisory — never a merge gate. Disagree with a finding? Reply on it, or use the finding board under this review. Transcript
rv-20260818165100-1751f7.@ -97,0 +109,4 @@# as the fact that justifies it: `x-amz-credential=` and the URL-encoded# `X-Amz-Credential%3D` are both still flagged (verified against semgrep# 1.172.0). That keeps the evasion surface to the one exact canonical form# while every near-miss still trips the rule. gitleaks remains the primary.forgejo/semgrep-rules/tti.yml:112· MEDIUM — Inconsistent security rule baselineThe change updates a security rule in the local
.forgejo/semgrep-rules/tti.ymlfile but does not update the agency-wide canonical source attti/coding-standards/.forgejo/semgrep-rules/tti.yml. This violates the seeding and audit pattern, meaning the fix won't propagate to other repos during the next audit cycle.panel tally 4/4 · reply here or use the finding board to agree/disagree
AI review · advisory
Verdict: 1 thing worth fixing (1 high).
⚑ panel: GPT-OSS 120B · Gemma 4 31B · Devstral 2 123B · Laguna S 2.1 — 4 distinct (from 5 reviewer findings), 1 confirmed, 3 refuted · web: not used · context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Panel debate — how this review was reached
Grounding — context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Round 1 — independent reviews
Grouping — 5 reviewer findings describe 4 distinct defects; reviewers who found the same defect independently count as support.
Round 2 — cross-examination
GPT-OSS 120B#1Modification of seeded baseline workflow violates agency standard · also raised by: Gemma 4 31B · confirmed: Laguna S 2.1 · refuted: Devstral 2 123BDevstral 2 123B#1Regex pattern may allow unintended matches · confirmed: — · refuted: GPT-OSS 120B, Gemma 4 31B, Laguna S 2.1Devstral 2 123B#2Negative lookbehind may not be supported in all regex engines · confirmed: — · refuted: GPT-OSS 120B, Gemma 4 31B, Laguna S 2.1Devstral 2 123B#3Missing error handling for gitleaks command · confirmed: — · refuted: GPT-OSS 120B, Gemma 4 31B, Laguna S 2.1Raised but refuted (left out of the review above)
Devstral 2 123B#1Regex pattern may allow unintended matches — The regex^WPA[0-9]?-(Enterprise|Personal|PSK)$only allows an optional single digit afterWPA. It will matchWPA,WPA2,WPA3but will not mDevstral 2 123B#2Negative lookbehind may not be supported in all regex engines — Semgrep uses a regex engine that supports lookbehinds, including negative lookbehinds. The pattern(?<!X-Amz-Credential=)AKIA[0-9A-Z]{16}is therefoDevstral 2 123B#3Missing error handling for gitleaks command — The gitleaks step already checks the command's exit status withif ! ...; thenand provides explicit error messages in the block that follows. ThisSynthesis — Devstral 2 123B wrote the final review from 1 confirmed finding.
Transcript
rv-20260818184002-04b14d— full round outputs, web results, and model reasoning are viewable by anyone with access to this repository via the AI gateway.Advisory — never a merge gate. Disagree with a finding? Reply on it, or use the finding board under this review. Transcript
rv-20260818184002-04b14d.@ -284,2 +284,3 @@run: |if ! "$HOME/.local/bin/gitleaks" detect --no-banner --redact --verbose --exit-code 1; thenset -eu# Prefer the SEEDED org config, same precedence rule as the semgrep.forgejo/workflows/baseline.yml:286· HIGH — Modification of seeded baseline workflow violates agency standardThe PR directly edits the seeded baseline workflow file, which is against the coding standards. Changes should only be made in the canonical source and then reseeded, not modified in repo copies.
Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 3/4 · reply here or use the finding board to agree/disagree
AI review · advisory
Verdict: 4 things worth fixing (1 high · 2 medium · 1 low).
Findings that didn't map to a diff line:
.forgejo/workflows/baseline.yml:314· LOW — Advisory message points to wrong allowlist file pathThe error message for non‑credential findings advises adding an allowlist entry to "security/gitleaks/gitleaks.toml", but the repository’s allowlist file is actually ".forgejo/gitleaks.toml".
.forgejo/workflows/baseline.yml:451· LOW — Inconsistent error message formattingThe error message for workflow YAML parsing does not follow the same format as other error messages in the workflow.
⚑ panel: GPT-OSS 120B · Gemma 4 31B · Devstral 2 123B · Laguna S 2.1 — 7 distinct, 4 confirmed, 1 refuted · web: not used · context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Panel debate — how this review was reached
Grounding — context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Round 1 — independent reviews
Round 2 — cross-examination
GPT-OSS 120B#1Negative lookbehind may not be supported by Semgrep · confirmed: Devstral 2 123B · refuted: Gemma 4 31BGemma 4 31B#1Fragile gitleaks configuration discovery · confirmed: GPT-OSS 120B · refuted: Devstral 2 123B, Laguna S 2.1GPT-OSS 120B#2Root .gitleaks.toml is ignored by the new config selection logic · confirmed: Gemma 4 31B, Devstral 2 123B, Laguna S 2.1 · refuted: —Devstral 2 123B#1Incomplete AWS access key ID pattern · confirmed: — · refuted: GPT-OSS 120B, Gemma 4 31B, Laguna S 2.1GPT-OSS 120B#3Advisory message points to wrong allowlist file path · confirmed: Gemma 4 31B, Devstral 2 123B, Laguna S 2.1 · refuted: —Devstral 2 123B#3Inconsistent error message formatting · confirmed: — · refuted: Gemma 4 31B, Laguna S 2.1Devstral 2 123B#2Inconsistent error message formatting · confirmed: — · refuted: Gemma 4 31B, Laguna S 2.1Raised but refuted (left out of the review above)
Devstral 2 123B#1Incomplete AWS access key ID pattern — The semgrep rule now uses a negative look‑behind:pattern-regex: '(?<!X-Amz-Credential=)AKIA[0-9A-Z]{16}', which explicitly excludes the `X-Amz-CredSynthesis — Devstral 2 123B wrote the final review from 4 confirmed findings (+2 unconfirmed).
Transcript
rv-20260818190353-1189ec— full round outputs, web results, and model reasoning are viewable by anyone with access to this repository via the AI gateway.Advisory — never a merge gate. Disagree with a finding? Reply on it, or use the finding board under this review. Transcript
rv-20260818190353-1189ec.@ -93,4 +93,22 @@ rules:- "**/*.md"- "**/ops/provenance/**".forgejo/semgrep-rules/tti.yml:94· HIGH — Negative lookbehind may not be supported by SemgrepThe regex pattern uses a negative lookbehind
(?<!X-Amz-Credential=), which Semgrep’s regex engine does not support. This can cause the rule to be silently ignored or to fail at runtime.Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 2/4 · reply here or use the finding board to agree/disagree
@ -283,3 +283,3 @@- name: Secrets — gitleaks (tree scan, redacted findings)run: |if ! "$HOME/.local/bin/gitleaks" detect --no-banner --redact --verbose --exit-code 1; thenset -eu.forgejo/workflows/baseline.yml:285· MEDIUM — Fragile gitleaks configuration discoveryThe script checks for
.forgejo/gitleaks.tomlfirst, but the standard organizational pattern expectssecurity/gitleaks/gitleaks.tomlto be the primary location.Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 2/4 · reply here or use the finding board to agree/disagree
@ -284,2 +284,3 @@run: |if ! "$HOME/.local/bin/gitleaks" detect --no-banner --redact --verbose --exit-code 1; thenset -eu# Prefer the SEEDED org config, same precedence rule as the semgrep.forgejo/workflows/baseline.yml:286· MEDIUM — Root .gitleaks.toml is ignored by the new config selection logicThe script now prefers
.forgejo/gitleaks.tomlover the root.gitleaks.toml, so any allowlist entries in the root file will never be applied.Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 4/4 · reply here or use the finding board to agree/disagree
@ -286,0 +298,4 @@elif [ -f security/gitleaks/gitleaks.toml ]; thenGL_CFG="security/gitleaks/gitleaks.toml"fiif [ -n "$GL_CFG" ]; thenLOW — Inconsistent error message formatting
The error message for undefined names or unparseable files does not follow the same format as other error messages in the workflow.
Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 1/4 · reply here or use the finding board to agree/disagree
AI review · advisory
Verdict: 3 things worth fixing (1 medium · 2 low).
⚑ panel: GPT-OSS 120B · Gemma 4 31B · Devstral 2 123B · Laguna S 2.1 — 5 distinct, 3 confirmed, 0 refuted · web: not used · context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Panel debate — how this review was reached
Grounding — context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Round 1 — independent reviews
Round 2 — cross-examination
Gemma 4 31B#1Potential resource leak in Python loop · confirmed: GPT-OSS 120B, Devstral 2 123B, Laguna S 2.1 · refuted: —Devstral 2 123B#1Incomplete AWS access key ID pattern · confirmed: — · refuted: Gemma 4 31B, Laguna S 2.1Devstral 2 123B#3Potential false positives in expression marker detection · confirmed: — · refuted: Gemma 4 31B, Laguna S 2.1Gemma 4 31B#2Inefficient string search in loop · confirmed: Devstral 2 123B · refuted: Laguna S 2.1Devstral 2 123B#2Hardcoded runner labels · confirmed: GPT-OSS 120B · refuted: Gemma 4 31B, Laguna S 2.1Synthesis — Devstral 2 123B wrote the final review from 3 confirmed findings (+2 unconfirmed).
Transcript
rv-20260818193113-119597— full round outputs, web results, and model reasoning are viewable by anyone with access to this repository via the AI gateway.Advisory — never a merge gate. Disagree with a finding? Reply on it, or use the finding board under this review. Transcript
rv-20260818193113-119597.@ -94,3 +94,3 @@- "**/ops/provenance/**"- "**/.security-ignore*"pattern-regex: 'AKIA[0-9A-Z]{16}'# The negative lookbehind drops key ids that appear as the AWS SigV4MEDIUM — Incomplete AWS access key ID pattern
The regex pattern for AWS access key IDs does not exclude known test/placeholder keys, which can lead to false positives and unnecessary noise in security scans.
Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 1/4 · reply here or use the finding board to agree/disagree
@ -286,0 +298,4 @@elif [ -f security/gitleaks/gitleaks.toml ]; thenGL_CFG="security/gitleaks/gitleaks.toml"fiif [ -n "$GL_CFG" ]; then.forgejo/workflows/baseline.yml:301· LOW — Hardcoded runner labels may become outdatedThe list of known runner labels is hardcoded, so it won’t update when new runners are added, leading to incorrect advisory notes.
panel tally 2/4 · reply here or use the finding board to agree/disagree
@ -294,2 +317,4 @@echo " * Commit-pinned .security-ignore fingerprints cannot match here (the"echo " shallow commit changes every push) — fix the content instead."echo " * A finding that is NOT a credential (a protocol name, a fixture"echo " constant): it belongs in security/gitleaks/gitleaks.toml as an"MEDIUM — Potential false positives in expression marker detection
The expression marker detection logic may produce false positives by matching legitimate uses of the expression marker pattern in comments or strings.
panel tally 1/4 · reply here or use the finding board to agree/disagree
@ -408,18 +435,97 @@ jobs:print("files that do not. Add python3-yaml to the runner image.").forgejo/workflows/baseline.yml:435· MEDIUM — File handles not closed in loopThe code opens files with
open(path)but never closes them, which can exhaust file descriptors in large repositories and crash the program.Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 4/4 · reply here or use the finding board to agree/disagree
@ -411,0 +442,4 @@# changes -- ops/ci-triage.sh computes the live set from# action_runner.last_online and is the authority.KNOWN_LABELS = {"ubuntu-latest", "ubuntu-24.04", "spark-arm64"}.forgejo/workflows/baseline.yml:445· LOW — Inefficient string search for expression markersThe loop uses repeated
line.findcalls to locate markers, which is slower and less readable than using a regular expression.panel tally 2/4 · reply here or use the finding board to agree/disagree
AI review · advisory
Verdict: 3 things worth fixing (2 medium · 1 low).
Findings that didn't map to a diff line:
.forgejo/workflows/baseline.yml:335· MEDIUM — Possible Workflow Expression Injection in Python scriptThe Python script in the 'Workflow YAML parses' step uses
open(f, encoding="utf-8").read()to process workflow files, but the logic attempting to prevent Forgejo expression markers (${{) through concatenation (EXPR_OPEN = "$" + "{" + "{") only applies to the detection and printing logic, not the actual parsing. Whileyaml.safe_loadis used, if this script were modified to execute or interpolate these values, it would be vulnerable. More critically, the manual check forEXPR_OPENinexpr_defectsis meant to find defects, but the logicif line.find(EXPR_CLOSE, i + len(EXPR_OPEN)) == -1only checks if the marker is closed on the same line. Forgejo lexes these across the RAW file, meaning a marker opened on one line and closed on another is valid, but this script will flag it as a FAIL, causing false positives for multi-line expressions..forgejo/workflows/baseline.yml:408· MEDIUM — Inconsistent error handling in workflow YAML parsingThe workflow YAML parsing step does not handle the case where the YAML parser is missing, which could lead to silent failures.
⚑ panel: GPT-OSS 120B · Gemma 4 31B · Devstral 2 123B · Laguna S 2.1 — 7 distinct, 3 confirmed, 0 refuted · web: not used · context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Panel debate — how this review was reached
Grounding — context: 2 files · 90 codebase · 14 standards chunks (best-grounded: GPT-OSS 120B; smaller windows saw less)
Round 1 — independent reviews
Round 2 — cross-examination
Gemma 4 31B#1Possible Workflow Expression Injection in Python script · confirmed: Devstral 2 123B · refuted: —Devstral 2 123B#4Inconsistent error handling in workflow YAML parsing · confirmed: — · refuted: Gemma 4 31BDevstral 2 123B#3Inconsistent error handling in gitleaks step · confirmed: — · refuted: Gemma 4 31BLaguna S 2.1#1Allowlist regex suppresses real AWS key ids inX-Amz-Credential=parameter · confirmed: Gemma 4 31B · refuted: Devstral 2 123BDevstral 2 123B#1Missing header comment for gitleaks configuration · confirmed: — · refuted: Gemma 4 31BDevstral 2 123B#2Inconsistent pattern in semgrep rule · confirmed: — · refuted: Gemma 4 31BLaguna S 2.1#2gitleaks--configprecedence vs repo-root.gitleaks.tomlauto-discovery · confirmed: Gemma 4 31B, Devstral 2 123B · refuted: —Synthesis — Devstral 2 123B wrote the final review from 3 confirmed findings (+4 unconfirmed).
Transcript
rv-20260818200235-df4aad— full round outputs, web results, and model reasoning are viewable by anyone with access to this repository via the AI gateway.Advisory — never a merge gate. Disagree with a finding? Reply on it, or use the finding board under this review. Transcript
rv-20260818200235-df4aad.@ -0,0 +1,67 @@# TTI gitleaks configuration for the H2 baseline gate.MEDIUM — Missing header comment for gitleaks configuration
The gitleaks configuration file lacks a header comment explaining its purpose and usage, which is inconsistent with the repository's standard for configuration files.
Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 1/4 · reply here or use the finding board to agree/disagree
@ -93,4 +93,22 @@ rules:- "**/*.md".forgejo/semgrep-rules/tti.yml:93· MEDIUM — Allowlist regex may suppress real AWS key IDsThe regex
(?<!X-Amz-Credential=)AKIA[0-9A-Z]{16}only ignores the exactX-Amz-Credential=prefix, but real AWS key IDs could appear elsewhere in presigned URLs or logs, leading to false negatives.panel tally 2/4 · reply here or use the finding board to agree/disagree
.forgejo/semgrep-rules/tti.yml:93· MEDIUM — Allowlist regex may suppress real AWS key IDsThe regex
(?<!X-Amz-Credential=)AKIA[0-9A-Z]{16}only ignores the exactX-Amz-Credential=prefix, but real AWS key IDs could appear elsewhere in presigned URLs or logs, leading to false negatives.Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 1/4 · reply here or use the finding board to agree/disagree
@ -283,3 +283,3 @@- name: Secrets — gitleaks (tree scan, redacted findings)run: |if ! "$HOME/.local/bin/gitleaks" detect --no-banner --redact --verbose --exit-code 1; thenset -euMEDIUM — Inconsistent error handling in gitleaks step
The gitleaks step in the baseline workflow does not handle the case where the gitleaks configuration file is missing, which could lead to silent failures.
Proposed replacement (one-click ⚡ Apply on the findings board at the top of this PR):
panel tally 1/4 · reply here or use the finding board to agree/disagree
@ -286,0 +293,4 @@# than skipping the step — a missing allowlist is noise, a skipped# secret scan is a hole.GL_CFG=""if [ -f .forgejo/gitleaks.toml ]; then.forgejo/workflows/baseline.yml:296· LOW — Weak fallback to un-audited repo-root gitleaks configIf no seeded config is found, the workflow falls back to auto-discovering a repo-root
.gitleaks.toml, which may use weaker rules (e.g., missing allowlists). This could silently weaken security scans.panel tally 3/4 · reply here or use the finding board to agree/disagree
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.