security: CWE-295: Fix insecure IdP transport — VC-53762#661
Open
torresashjiancyber wants to merge 1 commit into
Open
security: CWE-295: Fix insecure IdP transport — VC-53762#661torresashjiancyber wants to merge 1 commit into
torresashjiancyber wants to merge 1 commit into
Conversation
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
Fixed CWE-295 vulnerability where OAuth2 token requests to the OIDC IdP could inherit the insecure global
http.DefaultTransportwhen--insecureflag is set, exposing credentials to TLS MITM attacks.Finding
CWE-295 / CWE-757: Improper Certificate Validation
CVSS: 8.2
The Firefly connector's
Authorize()method usedcontext.Background()for OAuth2 token calls (config.Token()andconfig.PasswordCredentialsToken()). When the globalhttp.DefaultTransporthasInsecureSkipVerify:trueset (via--insecureflag incmdHelper.go:170), these calls silently disable certificate validation for the IdP token endpoint, exposingclient_secretand passwords to TLS MITM attacks.Vulnerable code locations:
pkg/venafi/firefly/connector.go:148-config.Token(context.Background())pkg/venafi/firefly/connector.go:176-config.PasswordCredentialsToken(context.Background(), ...)Remediation
Created a dedicated TLS-verified HTTP client and injected it into the OAuth2 context:
Both token calls now use
idpCtxinstead ofcontext.Background(), ensuring IdP communication always validates certificates regardless of the global--insecuresetting.Verification
pkg/venafi/firefly/connector.goNote: Build/test failures are due to Go toolchain environment issues unrelated to this security fix.