Skip to content

fix(ci,device): drop workflow_dispatch ref input + narrow bare except in CPU info parser - #2914

Closed
vpetersson wants to merge 1 commit into
masterfrom
worktree-spicy-gliding-stearns
Closed

fix(ci,device): drop workflow_dispatch ref input + narrow bare except in CPU info parser#2914
vpetersson wants to merge 1 commit into
masterfrom
worktree-spicy-gliding-stearns

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

Addresses two legitimate findings from a shoulder.dev security scan. The rest of the report was triaged as false positives (the upload path-traversal sinks are protected by uuid.*().hex + _SAFE_EXT_RE; the @authorized decorator covers the routes shoulder flagged as "missing authz"; mark_safe in asset_filters.to_json is preceded by JSON-encode and &<>' hex-escape; the open-redirect sink uses reverse() + url_has_allowed_host_and_scheme; etc.).

Description

  • .github/workflows/marketing-screenshots.yaml — drop the workflow_dispatch inputs.ref. The GH UI's "Use workflow from" picker already sets github.ref for operator-triggered runs, so the explicit input only added capability to API callers — a stolen GITHUB_TOKEN with actions:write could otherwise dispatch this workflow against an attacker-supplied SHA / fork ref and execute it on a runner.
  • src/anthias_common/device_helper.py — replace except Exception: pass in parse_cpu_info with an explicit split-length guard + continue. Also fixes a latent bug: under the old pass fall-through, a malformed /proc/cpuinfo line would land in the if key in [...]: cpu_info[key.lower()] = value block with value carried over from the previous iteration (or unbound on the first line).
  • .gitignore — shoulder.dev's local cache directory.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

🤖 Generated with Claude Code

… in CPU info parser

- .github/workflows/marketing-screenshots.yaml: remove `inputs.ref` from
  workflow_dispatch. The GH UI's "Use workflow from" picker already sets
  github.ref; the explicit input only gave API callers with a stolen
  actions:write token a way to dispatch against an attacker-supplied
  SHA / fork ref.
- src/anthias_common/device_helper.py: replace bare `except Exception:
  pass` in parse_cpu_info with a split-length guard. Also fixes a
  latent bug where `value` could be referenced unbound after a
  malformed `/proc/cpuinfo` line fell through the except.
- .gitignore: add the shoulder.dev local cache directory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vpetersson
vpetersson requested a review from a team as a code owner May 19, 2026 13:54
@vpetersson vpetersson self-assigned this May 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

@vpetersson-bot

Copy link
Copy Markdown
Contributor

Superseded by #3217. That PR was opened from a stale worktree branch (2026-05); all three findings are still present on master, so I reimplemented them against current master (the actions/checkout pin has since advanced to v7.0.1) and added a regression test for the parse_cpu_info stale-value bug. Closing in favor of the fresh PR.

@vpetersson-bot

Copy link
Copy Markdown
Contributor

Reimplemented as #3217 (built on current master — the actions/checkout pin has since moved to v7.0.1 — plus a regression test for the parse_cpu_info stale-value bug). All three findings here are still present on master, so this is superseded rather than obsolete.

Safe to close in favor of #3217 whenever you're ready — I don't have permission to close it from here.

@vpetersson vpetersson closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants