Skip to content

Commit 397444b

Browse files
committed
fix(redaction): keep prefixed secret keys masked while leaving Infisical's bare secretKey visible
1 parent 5a84548 commit 397444b

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎apps/sim/lib/core/security/redaction.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ describe('isSensitiveKey', () => {
3131
'exa_api_key',
3232
'secretAccessKey',
3333
'awsSecretAccessKey',
34+
'bedrockSecretKey',
35+
'apiSecretKey',
36+
'clerkSecretKey',
37+
'stripe_secret_key',
3438
'deployKey',
3539
'convexDeployKey',
3640
`${'a'.repeat(10000)}password`,

‎apps/sim/lib/core/security/redaction.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ const SENSITIVE_KEY_PATTERNS: RegExp[] = [
2929
/^.*api[_-]?key$/i,
3030
// AWS's `secretAccessKey` / `awsSecretAccessKey`, which no suffix above covers.
3131
/^.*secret[_-]?access[_-]?key$/i,
32-
// Convex's `deployKey`. A bare `secretKey` is left out: Infisical returns each
33-
// secret's name in that field, and redacting it would hide every listed name.
32+
// Prefixed secret keys such as Bedrock's `bedrockSecretKey` and Clerk's `clerkSecretKey`.
33+
// The prefix is required: Infisical returns each secret's name in a bare `secretKey`
34+
// field, and redacting it would hide every listed name.
35+
/^.+secret[_-]?key$/i,
36+
// Convex's `deployKey`.
3437
/^.*deploy[_-]?key$/i,
3538
/^passphrase$/i,
3639
/^authorization$/i,

‎apps/sim/lib/credentials/token-service-accounts/validators/http.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ async function sendThroughEgress(
184184
{ url, method = 'GET', headers, body }: TokenCheckRequest
185185
): Promise<ProviderResponse> {
186186
// A forward proxy re-resolves the host, so the transport refuses one with any refused record.
187+
// An unparseable URL skips the proxy lookup; validation then refuses it as the user's input.
187188
const validation = await validateUrlWithDNS(url, 'url', profile, {
188189
logDetails: false,
189-
requireEveryAddress: resolveEnvironmentProxy(new URL(url)) !== null,
190+
requireEveryAddress: URL.canParse(url) && resolveEnvironmentProxy(new URL(url)) !== null,
190191
})
191192
if (!validation.isValid) {
192193
if (validation.refusal !== 'dns') throw hostNotAllowed()

0 commit comments

Comments
 (0)