Skip to content

chore(deps)(deps): bump alpine from 865b95f to 2510918 in /gearbox in the docker-images group - #2

Merged
github-actions[bot] merged 1 commit into
mainfrom
dependabot/docker/gearbox/docker-images-60be0b6e22
Feb 1, 2026
Merged

chore(deps)(deps): bump alpine from 865b95f to 2510918 in /gearbox in the docker-images group#2
github-actions[bot] merged 1 commit into
mainfrom
dependabot/docker/gearbox/docker-images-60be0b6e22

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jan 31, 2026

Copy link
Copy Markdown
Contributor

Bumps the docker-images group in /gearbox with 1 update: alpine.

Updates alpine from 865b95f to 2510918

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions

@dependabot @github

dependabot Bot commented on behalf of github Jan 31, 2026

Copy link
Copy Markdown
Contributor Author

Labels

The following labels could not be found: dependencies, docker. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@dependabot
dependabot Bot force-pushed the dependabot/docker/gearbox/docker-images-60be0b6e22 branch from 70a1762 to 5515944 Compare February 1, 2026 09:15
Bumps the docker-images group in /gearbox with 1 update: alpine.


Updates `alpine` from `865b95f` to `2510918`

---
updated-dependencies:
- dependency-name: alpine
  dependency-version: '3.23'
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: docker-images
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/docker/gearbox/docker-images-60be0b6e22 branch from 5515944 to e5e0702 Compare February 1, 2026 15:08
@github-actions
github-actions Bot merged commit 759ee5d into main Feb 1, 2026
3 of 11 checks passed
@dependabot
dependabot Bot deleted the dependabot/docker/gearbox/docker-images-60be0b6e22 branch February 1, 2026 15:10
sarg3nt added a commit that referenced this pull request May 11, 2026
* fix(security): validate haproxy.backend.name + haproxy.acl.ip labels

Both labels flowed unvalidated from Docker Compose YAML into HAProxy
config via fmt.Sprintf in the generator. An author with push access to a
scraped repo could embed newlines plus arbitrary HAProxy directives in
either label and have them executed by HAProxy at the next reload, which
runs with the agent's privileges (root in the documented deployment).

Concrete impact:
- haproxy.backend.name flows to "backend %s", "  server %s_srv", and
  "  use_backend %s if is_%s". Newline injection lands directly inside
  the backend block, so directives like lua-load (arbitrary Lua exec
  at startup if Lua is compiled in) or errorfile <path> (arbitrary
  host-file read at startup) become attacker-controlled.
- haproxy.acl.ip flows to "  acl ip_allowed_* src %s". Same shape; an
  injected "acl admin src 0.0.0.0/0" silently widens any IP allowlist.

Fix:
- New validBackendName regex (DNS-label-style) enforced at parser time.
  Default-generated names from sanitizeName always pass it; user-supplied
  names from the label must match or the backend is rejected entirely.
- New validateACLIPList helper that splits on comma, trims whitespace,
  and requires every entry to parse as net.ParseCIDR or net.ParseIP.
  Embedded whitespace (newlines, tabs) is rejected up front.

Both failure modes reject the whole backend rather than silently dropping
the offending field, since fall-through to "no ACL = open access" or
"no backend name = whatever the generator produces" is worse than just
not routing that service.

Tests added that round-trip the actual exploit payloads through ParseFile
and assert zero backends are returned.

P0-1 and P0-2 from the 2026-05 security audit.

* docs(security): correct bcrypt cost + remove false encryption-at-rest claim

Two doc errors caught by the 2026-05 security audit (P0-3):

1. SECURITY.md claimed bcrypt cost 10. The code has been using cost 12
   since gearbox/internal/framework/auth/password.go was written; the
   doc just never caught up. Cost 12 is the 2026 OWASP baseline, so
   the code is right and the doc was lagging.

2. SECURITY.md claimed "Credential Encryption: API keys encrypted at
   rest (AES-256-GCM)". That implementation does not exist anywhere in
   the codebase — a grep for "aes" / "GCM" / "cipher" returns zero hits
   in gearbox-agent. Secrets are protected by filesystem permissions
   (mode 0600) only. The claim is replaced with an honest description
   of the actual posture, plus guidance on how to layer real
   encryption-at-rest underneath (FDE / KMS).

Also adds the 2026-05 audit to the Security Audit History table.

The "real fix" for #2 (implementing envelope encryption with a KMS- or
TPM-backed key) is tracked separately; co-locating the decryption key
with the ciphertext on the same filesystem buys nothing real and the
honest doc is more defensible than the theatrical implementation.

* fix(security): tighten ?return=... allowlist on login + logout

The post-login redirect honored an arbitrary ?return= query value as
long as it wasn't literally /login or /logout. An attacker phishing a
victim to https://gearbox.example.com/login?return=https://attacker
would land them on the attacker's harvest page immediately after a
successful login, with the URL bar showing only the moment of redirect
from a legitimate origin. The Logout handler had the same shape and
could relay the value back to the login page.

Replace the two-string blocklist with a same-origin allowlist:
isSafeReturnURL accepts only relative paths starting with `/`, rejects
protocol-relative `//host`, rejects `/\…` (some browsers normalize the
backslash to a forward slash, opening another protocol-relative path),
rejects any embedded backslash, and rejects schemed URIs entirely.
Applies to both LoginPost and Logout.

Test pins down the accept/reject matrix including the textbook bypasses
(`//evil.example.com`, `/\evil.example.com`, `javascript:`, `data:`).

P0-4 from the 2026-05 security audit.
sarg3nt added a commit that referenced this pull request May 14, 2026
- Lint: golangci-lint's `unused` check runs without the `dev` build tag,
  so the shared constants in dev_bypass.go were flagged. Delete the
  shared file and inline the two constants into dev_bypass_on.go where
  they are actually referenced.

- Doc accuracy (Copilot #1, #2): the `-tags dev` flag is set by the
  `dev:` target in gearbox/Makefile via `air --build.cmd "$(DEV_BUILD_CMD)"`,
  not by `.air.toml` (which is gitignored per-developer). Update the
  package doc and four function/header comments in dev_bypass_on.go,
  and the corresponding section in gearbox/docs/development.md, to
  reference the Makefile and drop the broken `../.air.toml` link.

- Security (Copilot #3): EnsureDevUserExists previously returned early
  if a `dev` row already existed, leaving its password_hash untouched.
  A developer who manually set a password on that row could then form-
  login as a `dev` admin, contradicting the "form-login can never
  authenticate as this user" claim. Always rewrite password_hash to
  the caller-supplied dummyPasswordHash, plus reset status and
  must_change_password back to the safe defaults, on every call.
  Other fields (role, names) are still preserved across runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sarg3nt added a commit that referenced this pull request May 14, 2026
* feat(#83): dev-only loopback auto-login bypass

Compiled in only when the binary is built with `-tags dev` (which the
`make dev` target now passes via air's --build.cmd). When all three of
these hold the request is auto-authenticated as the seeded `dev` user:

  1. Build tag `dev` is set.
  2. GEARBOX_DEV_AUTO_LOGIN=1 in the environment.
  3. Post-RealIP RemoteAddr is a loopback IP.

Production builds (`make build`) replace every entry point with a
no-op stub via dev_bypass_off.go, so the bypass code, env-var check,
loopback check, seed function, and banner are not present in release
binaries at all.

Verified:
  - dev binary contains GEARBOX_DEV_AUTO_LOGIN and seed/banner strings;
    prod binary contains only the tryDevBypass no-op stub symbol.
  - cookieless GET /  ->  303 /haproxy (auto-login).
  - cookieless GET / with X-Forwarded-For: 1.2.3.4  ->  303 /login
    (chi.RealIP rewrites RemoteAddr, loopback check declines).

The seeded `dev` user has the package-level dummyPasswordHash so the
form-login path can never authenticate as it; only the loopback bypass
can. The seed is itself build-tag-gated (users_dev.go) so prod doesn't
even contain the seed function.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(#83): address Copilot review on #84

- Lint: golangci-lint's `unused` check runs without the `dev` build tag,
  so the shared constants in dev_bypass.go were flagged. Delete the
  shared file and inline the two constants into dev_bypass_on.go where
  they are actually referenced.

- Doc accuracy (Copilot #1, #2): the `-tags dev` flag is set by the
  `dev:` target in gearbox/Makefile via `air --build.cmd "$(DEV_BUILD_CMD)"`,
  not by `.air.toml` (which is gitignored per-developer). Update the
  package doc and four function/header comments in dev_bypass_on.go,
  and the corresponding section in gearbox/docs/development.md, to
  reference the Makefile and drop the broken `../.air.toml` link.

- Security (Copilot #3): EnsureDevUserExists previously returned early
  if a `dev` row already existed, leaving its password_hash untouched.
  A developer who manually set a password on that row could then form-
  login as a `dev` admin, contradicting the "form-login can never
  authenticate as this user" claim. Always rewrite password_hash to
  the caller-supplied dummyPasswordHash, plus reset status and
  must_change_password back to the safe defaults, on every call.
  Other fields (role, names) are still preserved across runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants