Skip to content

Delete unused rpc.DefaultTransport and reject out-of-range integer attrs#977

Open
phinze wants to merge 2 commits into
mainfrom
phinze/code-scanning-sweep-cleanup
Open

Delete unused rpc.DefaultTransport and reject out-of-range integer attrs#977
phinze wants to merge 2 commits into
mainfrom
phinze/code-scanning-sweep-cleanup

Conversation

@phinze

@phinze phinze commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

rpc.DefaultTransport was an exported package var carrying InsecureSkipVerify: true, which is the sort of thing worth a second look. It turns out nothing referenced it outside its own init(). Real client connections build their TLS config from State.clientTlsCfg and pin the peer certificate through VerifyPeerCertificate, so this transport was never in any code path. Deleting it is both the fix and the explanation. DefaultQUICConfig sitting next to it is genuinely used and stays.

MakeAttr parsed integer attribute values with ParseInt(..., 64) and then converted to int, which silently truncates on a 32-bit build. Since the value arrives over the wire, an oversized input would have been stored as some unrelated number rather than refused. Atoi parses at the platform's int width and returns ErrRange, so the error path that was already there now catches it.

Two revs since the changes are unrelated.

phinze added 2 commits July 24, 2026 17:04
DefaultTransport had no references anywhere outside its own init().
Live client connections build TLS config from State.clientTlsCfg and
pin the peer certificate through VerifyPeerCertificate, so nothing ever
reached this transport or the InsecureSkipVerify on it.

Removing it clears a CodeQL go/disabled-certificate-check alert that was
pointing at dead code. DefaultQUICConfig stays, since client.go and
State.qc both still use it.
MakeAttr parsed with ParseInt(..., 64) and then converted to int, which
silently truncates on 32-bit builds. The value is user-supplied, so an
oversized input would be stored as some unrelated number rather than
refused.

Atoi parses at the platform's int width and returns ErrRange, so the
existing error path rejects it at the boundary. Clears a CodeQL
go/incorrect-integer-conversion alert.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4abfca0-f8a9-4d93-b5f3-f6dda886656b

📥 Commits

Reviewing files that changed from the base of the PR and between 7f611d5 and 50a8524.

📒 Files selected for processing (2)
  • pkg/rpc/state.go
  • servers/entityserver/entityserver.go
💤 Files with no reviewable changes (1)
  • pkg/rpc/state.go

📝 Walkthrough

Walkthrough

Removed the exported DefaultTransport and its initialization wiring from the RPC state configuration while retaining the default QUIC configuration and log level. Updated entity integer attribute parsing to use strconv.Atoi, causing values outside the platform’s int range to return an invalid integer error instead of being cast from a 64-bit result.


Comment @coderabbitai help to get the list of available commands.

@phinze
phinze marked this pull request as ready for review July 24, 2026 22:16
@phinze
phinze requested a review from a team as a code owner July 24, 2026 22:16
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