Commit Graph

12467 Commits

Author SHA1 Message Date
Rowan Smith 6e9377d3dc fix: update tailscale fork to fix TSMP/ICMP callback leak (backport 2.31) (#25471)
Backport of #25469 to `release/2.31`.

Updates `github.com/coder/tailscale` to
[`v1.1.1-0.20260519043957-6f014ff9434f`](https://github.com/coder/tailscale/commit/6f014ff9434f8c7c4b5b0b0450cbaf2e8b4a52af)
to include the fix from
[coder/tailscale#122](https://github.com/coder/tailscale/pull/122),
which ports the upstream
[tailscale/tailscale#18113](https://github.com/tailscale/tailscale/pull/18113)
fix for TSMP/ICMP callback leaks.

Fixes #25380

> Generated with [Coder Agents](https://coder.com) by @rowansmithau
v2.31.14
2026-05-19 16:37:55 -04:00
github-actions[bot] 45ab52208d docs: Fix the display of the tab block in External Workspaces (#25341) (#25344)
Backport of https://github.com/coder/coder/pull/25341

Original PR: #25341 — docs: Fix the display of the tab block in External
Workspaces
Merge commit: 507ece3bc4
Requested by: @nickvigilante

Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com>
v2.31.13
2026-05-18 13:05:32 -04:00
github-actions[bot] dc3c95428a fix(coderd/azureidentity): add Azure IMDS G2 chain certificates (#25243) (#25347)
Backport of https://github.com/coder/coder/pull/25243

Original PR: #25243 — fix(coderd/azureidentity): add Azure IMDS G2 chain
certificates
Merge commit: 49c6191bbe
Requested by: @geokat

Co-authored-by: George K <george@coder.com>
2026-05-14 13:01:11 -07:00
github-actions[bot] b5496f255a docs: update screenshot to point to generic URL (#25314) (#25320)
Backport of https://github.com/coder/coder/pull/25314

Original PR: #25314 — docs: update screenshot to point to generic URL
Merge commit: 7aaa8485db
Requested by: @nickvigilante

Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com>
2026-05-13 17:24:22 -04:00
Seth Shelnutt dfe986b2b0 fix(scripts/ironbank): rebuild bundled Terraform from source with Go 1.25.9 (#25260)
Build Terraform from source during the IronBank image build instead of
downloading pre-built binaries from HashiCorp. This controls the Go
toolchain version, ensuring Go stdlib CVEs (1 Critical, 5 High, 3
Medium) fixed in Go 1.25.9 are addressed in the bundled Terraform
binary.

No upstream Terraform release is compiled with Go 1.25.9+; all use Go
1.25.8. Building from source with GOTOOLCHAIN=go1.25.9 (read from
go.mod) is the only path forward without waiting for an upstream
toolchain bump.

### Changes
- **hardening_manifest.yaml**: Replace pre-built Terraform 1.3.7 binary
with Terraform 1.14.5 source tarball (matches `install.go`). Update
terraform-provider-coder from 0.6.10 to 2.13.1 (matches `go.mod`). Add
`TERRAFORM_VERSION` build arg.
- **build_ironbank.sh**: Download Terraform source, compile with the
project's Go toolchain (1.25.9), package as terraform.zip. Add `go` to
dependencies. Update base image to UBI9.
- **Dockerfile**: Update base image from UBI8 8.7 to UBI9 9.6. Remove
python3-urllib3 to address CVE-2026-44431.

Refs ENT-1

> [!NOTE]
> Generated by Coder Agents

<details>
<summary>Implementation context (Coder Agents generated)</summary>

### Go toolchain analysis
| Component | Before | After |
|-----------|--------|-------|
| Terraform binary | Go 1.19.4 (v1.3.7 pre-built) | Go 1.25.9 (v1.14.5
built from source) |
| terraform-provider-coder | old (v0.6.10) | Go 1.24.6 (v2.13.1) |
| Coder binary | Go 1.25.9 | Go 1.25.9 (unchanged) |

### Related PRs
- #25219 — main
- #25250 — release/2.33
- #25259 — release/2.32
</details>
v2.31.12
2026-05-13 15:36:01 -04:00
Spike Curtis 6ff657f090 fix: verify PKCS7 signature on Azure instance identity tokens (backport 2.31) (#25304)
Backport of: #25286

Migrates Azure instance identity verification from
`go.mozilla.org/pkcs7` and `github.com/fullsailor/pkcs7` to
`github.com/smallstep/pkcs7`, using `VerifyWithChainAtTime` to validate
both the PKCS7 signature and the certificate chain in one call. The
previous code only verified the signer certificate against a set of
intermediates/roots but did not verify that the PKCS7 signature itself
covered the content, meaning tampered payloads could be accepted.

The `Options` struct is restructured to accept `Roots`, `Intermediates`,
and `CurrentTime` as explicit fields instead of embedding
`x509.VerifyOptions`. The test helper `NewAzureInstanceIdentity` now
builds a realistic 3-level certificate chain (Root CA -> Intermediate CA
-> Signing Cert) matching real Azure trust hierarchy. New tests
(`TestValidate_TamperedContent`,
`TestValidate_UntrustedCertWithValidSignature`) confirm tampered and
untrusted envelopes are rejected.

Addresses GHSA-6x44-w3xg-hqqf.

> [!NOTE]
> This PR was authored by Coder Agents.

<details>
<summary>Implementation Plan</summary>

| File | Summary |
|------|---------|
| `coderd/azureidentity/azureidentity.go` | Replace `signer.Verify()`
with `VerifyWithChainAtTime`; restructure `Options` struct; add
`ParseCertificates()` helper |
| `coderd/azureidentity/azureidentity_test.go` | Add `testCertChain`
builder, tampered-content and untrusted-cert tests; update existing
tests for new `Options` API |
| `coderd/coderd.go` | Change `AzureCertificates` field from
`x509.VerifyOptions` to `azureidentity.Options` |
| `coderd/workspaceresourceauth.go` | Pass `api.AzureCertificates`
directly instead of wrapping |
| `coderd/coderdtest/coderdtest.go` | Migrate to `smallstep/pkcs7`;
build 3-level cert chain in test helper |
| `go.mod` / `go.sum` | Add `github.com/smallstep/pkcs7`; remove
`fullsailor/pkcs7` and `go.mozilla.org/pkcs7` |

</details>

<!--

If you have used AI to produce some or all of this PR, please ensure you
have read our [AI Contribution
guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING)
before submitting.

-->

Co-authored-by: Jakub Domeracki <jakub@coder.com>
2026-05-13 13:56:43 -04:00
Jakub Domeracki eb461163c7 fix(coderd): harden Azure identity certificate fetch (cherry-pick v2.31) (#25278)
Cherry-pick of
https://github.com/coder/coder/commit/57b11d405f17492aa789d4b9ff33366f961a37f8
to `release/2.31`.

Backport of #25274.

> [!NOTE]
> This PR was created by Coder Agents on behalf of a human.
2026-05-13 17:35:00 +02:00
Seth Shelnutt bddd73d5d2 chore: bump Go from 1.25.9 to 1.25.10 (#25220)
Bumps Go toolchain from 1.25.9 to 1.25.10 on the v2.31.x release branch
to address 11 Go stdlib CVEs identified in the IronBank v2.31.11 scan.

Go 1.25.10 ([release notes](https://go.dev/doc/devel/release#go1.25.10))
includes security fixes to the go command, the pack tool, and the
`html/template`, `net`, `net/http`, `net/http/httputil`, `net/mail`, and
`syscall` packages.

Fixes: https://linear.app/codercom/issue/ENT-2

<details>
<summary>CVEs addressed</summary>

**High**
- CVE-2026-42501: Malicious module proxy can bypass checksum database
validation
- CVE-2026-39820: net/mail ParseAddress/ParseAddressList excessive
CPU/memory
- CVE-2026-33811: net LookupCNAME double-free and crash (cgo resolver)
- CVE-2026-33814: net/http HTTP/2 SETTINGS MAX_FRAME_SIZE=0 infinite
loop
- CVE-2026-39836: net Dial/LookupPort panic on Windows with NUL byte
(Windows-only)

**Medium**
- CVE-2026-39819: go bug writes to predictable temp file names (symlink
attack)
- CVE-2026-39817: go tool pack unsanitized output filenames (arbitrary
file write)

**Low**
- CVE-2026-42499: net/mail consumePhrase DoS
- CVE-2026-39826: html/template incorrect escaping in script tags
- CVE-2026-39825: net/http/httputil ReverseProxy hidden query parameters
- CVE-2026-39823: html/template XSS via whitespace in meta content
attribute

</details>

<details>
<summary>Note on Terraform binary</summary>

The Terraform binary bundled in the IronBank image is downloaded from
HashiCorp releases. Rebuilding it with Go 1.25.10+ requires an upstream
Terraform release. This PR addresses the Coder binary; the Terraform
binary fix depends on upstream.

</details>

> 🤖 Generated with [Coder Agents](https://coder.com)
> Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-05-13 09:29:44 -04:00
Seth Shelnutt e7030b122b fix(site): remove flaky pagination test from WorkspacesPage (cherry-pick #24165) (#25239)
Cherry-pick of #24165 to `release/2.31`.

Removes the flaky pagination query key test that timed out in CI (6204ms
vs 5000ms limit) because `renderWithAuth` boots 12+ MSW round-trips
before the page mounts.

On this branch `WorkspacesPage.stories.tsx` does not exist, so the test
is removed rather than moved to a story.

> 🤖 Generated by Coder Agent
2026-05-12 21:29:23 -04:00
Seth Shelnutt cd6eb46777 fix: bump goldmark to v1.7.17 to fix XSS (CVE-2026-5160) (#25216)
Bump `github.com/yuin/goldmark` from v1.7.16 to v1.7.17 to fix
[CVE-2026-5160](https://nvd.nist.gov/vuln/detail/CVE-2026-5160).

goldmark v1.7.16 is vulnerable to XSS due to improper ordering of URL
validation and normalization. The renderer validates link destinations
using a prefix-based check (`IsDangerousURL`) before resolving HTML
entities, allowing an attacker to bypass validation with entity-encoded
`javascript:` URIs.

This is the minimal fix for the IronBank finding on the
`coder/coder-enterprise/coder-service-2:2.31.11` image. The fix is
already on `main` (v1.8.2 via Hugo bump in #23957); this targets the
v2.31.x release branch with only the goldmark dependency change.

Closes [ENT-8](https://linear.app/codercom/issue/ENT-8)

> Generated by Coder Agents
2026-05-12 20:36:45 -04:00
Seth Shelnutt 441a9aba0c chore: bump github.com/go-git/go-git/v5 from 5.18.0 to 5.19.0 (release/2.31) (#25236)
Bumps `github.com/go-git/go-git/v5` from 5.18.0 to 5.19.0 on the
release/2.31 branch to fix CVE-2026-45022 (GHSA-389r-gv7p-r3rp):
go-git's improper parsing of specially crafted objects may lead to
inconsistent interpretation compared to upstream Git.

Equivalent of [#25124](https://github.com/coder/coder/pull/25124) on
main, adapted for the release/2.31 dependency tree.

Supersedes #25215 (rebased on top of #25212, #25213, #25214).

Fixes https://linear.app/codercom/issue/ENT-3

> [!NOTE]
> 🤖 Generated with [Coder Agents](https://coder.com)
2026-05-12 19:55:56 -04:00
Seth Shelnutt 17b857ea29 fix(security): bump gomarkdown/markdown to fix OOB read (GHSA-77fj-vx54-gvh7) (#25218)
Cherry-picks the gomarkdown/markdown bump from main (#24567) to
`release/2.31`.

Updates `github.com/gomarkdown/markdown` from
`v0.0.0-20240930133441-72d49d9543d8` to
`v0.0.0-20260411013819-759bbc3e3207`, fixing GHSA-77fj-vx54-gvh7 (OOB
Read in SmartypantsRenderer).

Note: `coderd/render/markdown.go` uses `html.CommonFlags` which enables
Smartypants by default, so this code path is reachable. The bump
resolves the IronBank finding for image
`coder/coder-enterprise/coder-service-2:2.31.11`.

<details><summary>Codebase verification</summary>

Only `coderd/render/markdown.go` imports `gomarkdown`. It calls
`html.NewRenderer` with `html.CommonFlags`, which includes the
Smartypants flag. No explicit SmartypantsRenderer configuration exists,
but the default flags enable smartypants processing. The patched
revision fixes the OOB read in that code path.

</details>

Closes https://linear.app/codercom/issue/ENT-6

> 🤖 Generated with [Coder Agents](https://coder.com)

Co-authored-by: Lukasz <CommanderK5@users.noreply.github.com>
2026-05-12 17:42:54 -04:00
Seth Shelnutt 59248df4c0 fix: bump otel SDK from v1.42.0 to v1.43.0 (CVE-2026-39883) (#25214)
Bumps `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`
from v0.64.0 to v0.68.0, which transitively upgrades
`go.opentelemetry.io/otel/sdk` from v1.42.0 to v1.43.0. This fixes
CVE-2026-39883 (PATH hijacking via bare `kenv` command on BSD/Solaris)
flagged in the IronBank scan for `coder-service-2:2.31.11`.

Equivalent to [#24078](https://github.com/coder/coder/pull/24078) on
main.

References:
- [CVE-2026-39883 /
GHSA-hfvc-g4fc-pqhx](https://github.com/open-telemetry/opentelemetry-go/security/advisories/GHSA-hfvc-g4fc-pqhx)
- [IronBank
VAT](https://vat.dso.mil/vat/image?imageName=coder/coder-enterprise/coder-service-2&tag=2.31.11&branch=master)

> [!NOTE]
> Generated by [Coder Agents](https://coder.com) for
[ENT-5](https://linear.app/codercom/issue/ENT-5)
2026-05-12 17:40:23 -04:00
Seth Shelnutt 836ff8f1b4 fix: bump golang.org/x/net to v0.53.0 (CVE-2026-33814) (#25213)
Bumps `golang.org/x/net` from v0.52.0 to v0.53.0 on the v2.31.x release
branch to fix CVE-2026-33814, an HTTP/2 infinite loop DoS in
`x/net/http2` triggered by a `SETTINGS_MAX_FRAME_SIZE` of 0.

Refs [ENT-10](https://linear.app/codercom/issue/ENT-10)
Cherry-pick of the relevant portion of #24259.

### Changes

- `golang.org/x/net` v0.52.0 -> v0.53.0
- Transitive bumps: `x/crypto` v0.50.0, `x/sys` v0.43.0, `x/term`
v0.42.0, `x/text` v0.36.0

<details><summary>Context</summary>

The original PR #24259 (commit `10f0786`) bumps 7 `golang.org/x`
packages. A direct cherry-pick conflicts due to divergent `x/mod`
versions between `main` and `release/2.31`. This PR performs the minimal
manual bump of `go get golang.org/x/net@v0.53.0` followed by `go mod
tidy`.

</details>

> 🤖 Generated with [Coder Agents](https://coder.com)
> 
> Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-05-12 17:40:04 -04:00
Seth Shelnutt f34f6733b6 chore: bump aws-sdk-go-v2/service/s3 to v1.97.3 (GHSA-xmrv-pmrh-hhx2) (#25212)
Bumps `github.com/aws/aws-sdk-go-v2/service/s3` from v1.97.1 to v1.97.3
on the v2.31.x release branch to fix the EventStream header decoder DoS
vulnerability
([GHSA-xmrv-pmrh-hhx2](https://github.com/aws/aws-sdk-go-v2/security/advisories/GHSA-xmrv-pmrh-hhx2),
CVSS 5.9).

Cherry-pick equivalent of d87c5ef4 from main
([#24136](https://github.com/coder/coder/pull/24136)).

Fixes ENT-7

<details><summary>Context</summary>

IronBank image `coder/coder-enterprise/coder-service-2:2.31.11` flagged
by VAT scanner for this vulnerability. The fix was already on `main`;
this brings it to the release branch.

</details>

> 🤖 Generated with [Coder Agents](https://coder.com)
2026-05-12 17:39:51 -04:00
Jakub Domeracki 49be5f31d3 fix(coderd): backport frame-ancestors CSP fixes to 2.31 (#24474, #24529) (#24807)
Cherry-pick backport of #24474 and #24529 to `release/2.31`.

- #24474: fix(coderd): add frame-ancestors CSP directive to prevent
clickjacking
- #24529: fix(coderd): omit frame-ancestors CSP for embed routes

Both commits cherry-picked cleanly with no conflicts.

> Generated by Coder Agents
v2.31.11
2026-05-01 14:54:17 -04:00
Garrett Delfosse 1a078790b1 fix(coderd/externalauth): save refreshed token before validation (#24332) (backport to 2.31) (#24899)
Backport of https://github.com/coder/coder/pull/24332 to `release/2.31`.

Moves the `UpdateExternalAuthLink` call to immediately after
`TokenSource.Token()` succeeds (before validation). GitHub rotates
refresh tokens on use, so if post-refresh validation fails (e.g.
rate-limited 403), the new token was previously silently discarded,
forcing manual re-authentication.

Original PR: #24332
Merge commit: 2a1984f0e8

**Note:** This branch includes the cherry-pick of #22904 (optimistic
locking) as a prerequisite since #24332's tests depend on it. The #22904
backport PR is #24902. Once that merges, the overlapping commit in this
PR will be a no-op.

Cherry-picks applied cleanly with no conflicts.

> Generated by Coder Agents

---------

Co-authored-by: Kyle Carberry <kyle@coder.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
2026-05-01 14:51:22 -04:00
Garrett Delfosse bd06fc5d84 fix(externalauth): prevent race condition in token refresh with optimistic locking (#22904) (backport to 2.31) (#24902)
Backport of https://github.com/coder/coder/pull/22904 to `release/2.31`.

Adds an optimistic lock to `UpdateExternalAuthLinkRefreshToken` so that
a concurrent caller that lost a token-refresh race cannot overwrite a
valid token stored by the winner. The SQL `WHERE` clause now includes
`AND oauth_refresh_token = @old_oauth_refresh_token`.

Original PR: #22904
Merge commit: 53e52aef78

Cherry-pick applied cleanly with no conflicts.

> Generated by Coder Agents

Co-authored-by: Kyle Carberry <kyle@coder.com>
2026-05-01 14:45:56 -04:00
Jakub Domeracki e58ecf5839 fix(scripts): fix Windows version format for RC builds (#23542) (#24560)
Backport of https://github.com/coder/coder/pull/23542

Original PR: #23542 — fix(scripts): fix Windows version format for RC
builds
Merge commit: 7f75670f8d
Requested by: @f0ssel

---

> [!NOTE]
> This PR was created by Coder Agents.

Co-authored-by: Garrett Delfosse <garrett@coder.com>
v2.31.10
2026-04-28 16:09:54 -04:00
github-actions[bot] 173607c58c fix: bump hashicorp/hc-install to v0.9.4 and drop coder fork replace (#24547) (#24575)
Backport of https://github.com/coder/coder/pull/24547

Original PR: #24547 — chore: bump hashicorp/hc-install to v0.9.4 and
drop coder fork replace
Merge commit: bd3ed18fb1
Requested by: @ethanndickson

Co-authored-by: Ethan <39577870+ethanndickson@users.noreply.github.com>
2026-04-28 15:54:18 -04:00
Jakub Domeracki 680c3c1db8 fix!: terminal command confirmation dialog (cherry-pick to 2.31) (#24768)
Cherry-pick of #24650 and #24765 to release/2.31.

Adds a confirmation dialog before executing commands from the
`?command=` URL parameter in the terminal page. Canceling closes the
terminal window.

> 🤖 Generated by Coder Agents

---------

Co-authored-by: Seth Shelnutt <seth@coder.com>
2026-04-28 14:54:31 -04:00
Lukasz 8f24f4fac8 fix: backport Go 1.25.9 and dependency fixes (#24329)
## Summary
- backport `golang.org/x/net` 0.52.0, `go-getter` 1.8.6, and
`EventStream` 1.7.8 to `release/2.31`
- backport the Go toolchain bump to 1.25.9
- include the latest local backport commits on
`sec/release-2.31-security`

## Testing
- not run

---------

Co-authored-by: Ethan <39577870+ethanndickson@users.noreply.github.com>
2026-04-20 18:15:08 +02:00
github-actions[bot] a4e873e64f fix: widen engines.node to include Node.js 24 LTS (#24419) (#24469)
Backport of https://github.com/coder/coder/pull/24419

Original PR: #24419 — fix: widen engines.node to include Node.js 24 LTS
Merge commit: 1f194dcdff
Requested by: @CommanderK5

Co-authored-by: Jakub Domeracki <jakub@coder.com>
2026-04-17 14:30:01 +02:00
George K 2f5d21d1be perf: cap count queries, use native UUID ops for audit/conn logs (backport #23835) (#24129)
Backport of #23835.

Audit and connection log pages were timing out due to expensive COUNT(*)
queries over large tables. This commit adds opt-in count capping:
requests can return a `count_cap` field signaling that the count was
truncated at a threshold, avoiding full table scans that caused page
timeouts.

Text-cast UUID comparisons in regosql-generated authorization queries
also contributed to the slowdown by preventing index usage for
connection and audit log queries. These now emit native UUID operators.

Frontend changes handle the capped state in usePaginatedQuery and
PaginationWidget, optionally displaying a capped count in the pagination
UI (e.g. "Showing 2,076 to 2,100 of 2,000+ logs")

---

Cherry picked from 86ca61d6ca
v2.31.9
2026-04-09 12:46:59 -04:00
Lukasz 960b8e7fc1 chore: backport high and critical Iron Bank dependency fixes (#24110)
## Summary
- backport the high/critical Iron Bank dependency fixes needed on
release/2.31
- bump github.com/go-jose/go-jose/v4 to v4.1.4
- bump google.golang.org/grpc to v1.79.3 and github.com/buger/jsonparser
to v1.1.2

## Context
- main already contains the required fixes, so no main patch PR was
needed
- I checked whether the existing main patches could be cherry-picked
directly
- grpc and jsonparser have matching commits on main, but the backport
branch has drift in the same dependency blocks, so the release-branch
patch was applied as the minimal equivalent dependency bump instead of a
clean cherry-pick

## Validation
- make lint is blocked locally because the installed golangci-lint
binary was built with Go 1.24 while this branch targets Go 1.25.8
- go test ./... progresses and then fails in Docker-backed tests because
/var/run/docker.sock is unavailable in this environment
2026-04-09 18:02:46 +02:00
Lukasz 2587364ae8 chore: backport Go 1.25.8 bump to release/2.31 (#23941)
Backports #23772 to release/2.31.
Changes from https://github.com/coder/coder/pull/23772/

---------

Co-authored-by: Jakub Domeracki <jakub@coder.com>
Co-authored-by: Atif Ali <atif@coder.com>
2026-04-09 18:01:18 +02:00
Ethan 7a81efad90 fix: bump coder/tailscale to pick up RTM_MISS fix (release/2.31) (#24185)
## What

Bumps `coder/tailscale` to
[`e956a95`](https://github.com/coder/tailscale/commit/e956a950740bd737c55451f56e77038f7430a919)
([PR #113](https://github.com/coder/tailscale/pull/113)) to pick up the
`RTM_MISS` fix for the Darwin network monitor.

## Why

On Darwin, `RTM_MISS` route-socket messages (fired on every failed route
lookup) were not filtered by `netmon`, causing each one to be treated as
a `LinkChange`. When netcheck sends STUN probes to an IPv6 address with
no route, this creates a self-sustaining feedback loop: `RTM_MISS` →
`LinkChange` → `ReSTUN` → netcheck → v6 STUN probe → `RTM_MISS` → …

The loop drives DERP home-region flapping at ~70× baseline, which at
fleet scale saturates PostgreSQL's `NOTIFY` lock and causes coordinator
health-check timeouts.

The upstream fix adds a single `if msg.Type == unix.RTM_MISS { return
true }` check to `skipRouteMessage`. This is safe because `RTM_MISS` is
a lookup-path signal, not a table-mutation signal — route withdrawals
always emit `RTM_DELETE` before any subsequent lookup can miss.

## Scope

This is a targeted workaround to unblock a customer. The root cause —
why certain macOS versions generate elevated `RTM_MISS` traffic (likely
a change in IPv6 route-table initialization) — requires further
investigation.
v2.31.8
2026-04-09 17:01:55 +10:00
Atif Ali 40a0da27e1 chore(dogfood): remove trivy from Dockerfile (backport v2.31) (#23967)
Backport of #23367 to release/2.31.

The trivy v0.41.0 release assets have been removed from GitHub, causing
the dogfood image build to fail with `gzip: stdin: not in gzip format` —
the 404 HTML response gets piped into `tar`.

This is blocking #23941.

> 🤖 This PR was created with the help of Coder Agents, and needs a human
review. 🧑‍💻
2026-04-02 10:49:38 +00:00
blinkagent[bot] a7e9dfa7dc feat: add user:read scope (#23348) (#23841)
Co-authored-by: Kerem Kacel <keremkacel@gmail.com>
v2.31.7
2026-04-01 16:29:11 +05:00
Jakub Domeracki 8885d180fe chore: remove trivy GHA job (backport v2.31) (#23858) 2026-04-01 12:32:24 +05:00
Paweł Banaszewski 58446cc865 fix: update aibridge library to include AWS Bedrock fixes (#23801)
Updates aibridge library to include Bedrock fixes.
Contains fixes to https://github.com/coder/aibridge/issues/219 and
https://github.com/coder/aibridge/issues/221
2026-03-31 15:53:46 +02:00
Rowan Smith f7650296ce chore: switch agent gone response from 502 to 404 (backport #23090) (#23635)
Backport of #23090 to `release/2.31`.

When a user creates a workspace, opens the web terminal, then the
workspace stops but the web terminal remains open, the web terminal will
retry the connection. Coder would issue a HTTP 502 Bad Gateway response
when this occurred because coderd could not connect to the workspace
agent, however this is problematic as any load balancer sitting in front
of Coder sees a 502 and thinks Coder is unhealthy.

This PR changes the response to a HTTP 404 after internal discussion.

Cherry-picked from merge commit
c33812a430.
v2.31.6
2026-03-25 16:49:28 -04:00
Charlie Voiselle e419eb3101 fix: open coder_app links in new tab when open_in is tab (cherry-pick #23000) (#23620)
Cherry-pick of #23000 onto release/2.31.

Co-authored-by: Kayla はな <kayla@tree.camp>
2026-03-25 15:32:22 -04:00
Ethan 1a774ab7ce fix(tailnet): retry after transport dial timeouts (#22977) (cherry-pick/v2.31) (#22992)
Backport of #22977 to 2.31
v2.31.5
2026-03-13 14:26:48 -04:00
Rowan Smith 581e956b49 fix: prevent ui error when last org member is removed (#23019)
Backport of #22975 to release/2.31.
2026-03-13 14:22:40 -04:00
Jon Ayers 2cd4e03f11 fix: prevent emitting build duration metric for devcontainer subagents (#22930) 2026-03-10 20:31:05 -05:00
Susana Ferreira 61b513e586 fix: bump aibridge to v1.0.9 to forward Anthropic-Beta header (#22842)
Bumps aibridge to v1.0.9, which forwards the `Anthropic-Beta` header
from client requests to the upstream Anthropic API:
https://github.com/coder/aibridge/pull/205

This fixes the `context_management: Extra inputs are not permitted`
error when using Claude Code with AI Bridge.

Note: v1.0.8 was retracted due to a conflict marker cached by the Go
module proxy https://github.com/coder/aibridge/pull/208. v1.0.9 contains
the same fix.
v2.31.4
2026-03-10 15:52:04 -04:00
Jon Ayers 757634c720 fix: filter sub-agents from build duration metric (#22732) (#22919) 2026-03-10 14:11:01 -05:00
Jon Ayers a3792153de feat: add Prometheus collector for DERP server expvar metrics (#22583) (#22917)
backports the derp prometheus metrics
2026-03-10 12:29:15 -05:00
Steven Masley deaacff843 fix: early oidc refresh with fake idp tests (#22712) (cherry 2.31) (#22716)
Confirmed manually using this branch with 5min tokens (always refreshed)
and 15min tokens (refreshed after 5min elapsed)
v2.31.3
2026-03-06 14:33:33 -05:00
Steven Masley 2828d28e0c chore: prematurely refresh oidc token near expiry during workspace (cherry 2.31) (#22606)
(cherry picked from commit f49dea683c)
v2.31.2
2026-03-04 10:55:40 -06:00
Garrett Delfosse 4b95b8b4f9 fix(coderd): add organization_name label to insights Prometheus metrics (cherry-pick #22296) (#22566)
Backport of #22296 to release/2.31.
v2.31.1
2026-03-03 14:15:20 -05:00
Ehab Younes 3a061ccb21 refactor(site): use dedicated task pause/resume API endpoints (#22303) (cherry-pick/v2.31) (#22326)
Switch from workspace stop/start operations to the dedicated tasks pause
and resume endpoints for cleaner semantics.

(cherry picked from commit bf639d0016)

<!--

If you have used AI to produce some or all of this PR, please ensure you
have read our [AI Contribution
guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING)
before submitting.

-->
2026-03-03 13:14:19 -06:00
Ehab Younes 22c2da53e9 fix: register task pause/resume routes under /api/v2 (#22544) (#22550)
The pause/resume endpoints were only registered under /api/experimental
but the frontend and Go SDK were calling /api/v2, resulting in 404s.
Register the routes in the v2 group, update the SDK client paths, and
fix swagger annotations (Accept → Produce) since these POST endpoints
have no request body.

(cherry picked from commit 9d2aed88c4)
2026-03-03 13:13:48 -06:00
Kayla はな ccb529e98a fix: disable sharing ui when sharing is unavailable (#22390) (#22561) 2026-03-03 11:07:10 -07:00
Rowan Smith 107fd97a61 fix: avoid derp-related panic during wsproxy registration (backport release/2.31) (#22526)
Backport of #22322.

- Cherry-picked 7f03bd7.

Co-authored-by: Dean Sheather <dean@deansheather.com>
2026-03-03 13:46:42 +05:00
Jakub Domeracki 955637a79d fix(codersdk): use header auth for non-browser websocket dials (#22461) (cherry-pick/v2.31) (#22508)
Cherry-pick of #22461 to `release/2.31`.

Applies the non-browser websocket auth principle from #22226 to
remaining
`codersdk` websocket callsites, replacing cookie-jar session auth with
header-token auth. Fixes `401` failures on deployments with
`--host-prefix-cookie` enabled.

Closes #22461 (cherry-pick)

---------

Co-authored-by: ethan <ethanndickson@gmail.com>
2026-03-02 20:40:43 +01:00
Cian Johnston 85f1d70c4f ci: add temporary deploy override (#22378) (#22475)
Temporary override for deploying `main` to `dev.coder.com`.

(cherry picked from commit 67da4e8b56)
2026-03-02 13:58:06 +00:00
Cian Johnston e9e438b06e fix(stringutil): operate on runes instead of bytes in Truncate (#22388) (#22469)
Fixes https://github.com/coder/coder/issues/22375

Updates `stringutil.Truncate` to properly handle multi-byte UTF-8
characters.
Adds tests for multi-byte truncation with word boundary.

Created by Mux using Opus 4.6

(cherry picked from commit 0cfa03718e)
2026-03-02 11:19:16 +00:00
Steven Masley c339aa99ee chore: use header auth over cookies for agents (#22226) (cherry-pick/v2.31) (#22313)
All non-browser connections should not use cookies

(cherry picked from commit 3353e687e7)
2026-02-26 11:11:00 -06:00