security: fix 13 findings from security audit#843
Merged
Conversation
…raversal - Cross-env node deletion IDOR: verify node belongs to env before delete - Blank-password bypass on JIT SSO accounts: reject empty passwords, store unusable hash for SSO-only users - OIDC/SAML username-collision account takeover: reject federated login when username belongs to a local account or different auth source - Same fix in legacy admin binary - Missing email_verified gate on OIDC email claim as username - CarveBlockHandler env-membership check: verify carve env matches URL env - Path traversal via host_identifier in carve archive names: filepath.Base - Query result forgery: hard return on node/env mismatch in ProcessLogQueryResult - Enroll secret leaked to UserLevel users: apply projectEnvironmentView for non-admin callers in env list endpoint - Stored XSS in legacy admin status logs: HTML-escape DataTables render - Wrong permission level (QueryLevel→CarveLevel) in CarvesRunHandler extra-environment loop - Cross-env carve archive download: verify carve env matches requested env - S3 block_id bounds check: reject out-of-range values before int32 cast - Non-constant-time secret comparison: use subtle.ConstantTimeCompare in OsqueryConfigEndpointHandler
035cd79 to
2d36304
Compare
Allow federated users to login via both OIDC and SAML (same IdP, different protocol) by updating auth_source on each login instead of rejecting. Local accounts are still blocked from federated takeover. Wire SAML logout URL (--saml-logout-url / SAML_LOGOUT_URL) into the logout handler response so the SPA redirects to the IdP's logout endpoint, terminating the IdP session cookie. Without this, clicking "Continue with SAML" after logout silently re-authenticated.
2d36304 to
4ed2fbf
Compare
javuto
approved these changes
May 22, 2026
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
Addresses the 13 security findings identified in the evilsocket audit report. All fixes have been deployed and verified on a dockerized test environment (osctrl-api + osctrl-admin + osctrl-tls + Keycloak + Auth0 SAML) with 24 automated integration tests passing.
Findings fixed
GetByUUIDEnvlookup before delete innodes.goresolveFederatedUser: reject whenAuthSource==""(local); allow cross-protocol switch withChangeAuthSource()cmd/admin/oidc.goresolveOIDCUseremail_verifiedemail_verifiedinclaims.go; reject unverified emailscarve.EnvironmentID != env.IDcheck inpost.gofilepath.Base()on every path segment incarves/utils.goenvid != node.EnvironmentIDinlogging/process.goprojectEnvironmentView()stripsSecret,Certificate,Flags,ConfigTLSfor non-admin.text()instead of.html()for user-controlled fieldsCarveLevelthroughoutcarves.gohandlersget.go[0, 9998]ins3.gosubtle.ConstantTimeCompareinpost.goAdditional changes
POST /api/v1/loginauthenticates against all environments. Simplifies the SPA login flow (no env dropdown needed pre-auth).auth_sourceupdated on each federated login.osctrl_id_tokencookie (set only by OIDC callback) to determine which IdP logout flow to trigger, instead of relying on the user's creation-timeauth_source. Password users no longer get incorrectly redirected to the SAML IdP logout URL.Test plan
go vet ./...cleannpm run build)