Repository navigation
fix(connect): resolve the undo backup from the directory listing - #2028
Merged
Merged
Conversation
Undo built the backup path, and from it the undo record path, out of the name in the request. The name was already checked to be a bare filename that belongs to the client's config, but CodeQL reported the resulting paths as go/path-injection. Undo now looks the name up in the config directory and uses the name the directory lists; a name that is not listed gets the same not_found answer as before. fileDigest keeps the same SHA-256 value but goes through hash.Hash, and says in a comment that it is a change detector for a config file. Related #1971
Deploying mcpproxy-docs with
|
| Latest commit: |
c030420
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3fa680e3.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-codeql-oauth-connect.mcpproxy-docs.pages.dev |
Going through hash.Hash did not change what CodeQL reports, so the function is back to its original body; the comment stays. Related #1971
Dumbris
enabled auto-merge (squash)
November 24, 2026 11:24
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 45380764276 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #2025 for the CodeQL alerts it left open.
go/path-injection(alerts 902, 903;internal/connect/undo_record.go): Undo built the backup path, and from it the undo record path, out of the backup name in the request. The name was already validated (bare filename,<config>.bak.prefix), which CodeQL cannot see. Undo now looks the name up in the config directory and builds the path from the name the directory lists. A name that is not listed gets the samenot_foundanswer as before.internal/connect/connect.go), which had the same source.Not changed: alert 904 (
go/weak-sensitive-data-hashing).fileDigestis a change detector for the config file a connect wrote, not a credential hash; going throughhash.Hashmade no difference to CodeQL, so the body is the original direct call with a comment. A test pins the value to plain SHA-256. The alert needs a dismissal.Also not changed: alert 900 (
go/unvalidated-url-redirection,internal/server/oauth_login_http.go). That redirect goes to the client's registeredredirect_uri, which is what OAuth requires; it was dismissed as a false positive.Testing
go test -race ./internal/connect/ ./internal/httpapi/golangci-lint run --config .github/.golangci.yml ./internal/connect/...: 0 issuesGOOS=windows go vet ./internal/connect/Related #1971