Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: use bash mode for picomatch glob matching in OIDC, JWT, and SPIFFE auth

Devin AI68dfa74650c5
diff --git a/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts b/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts
index 57aa933d68..cffffe1b39 100644
--- a/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts
+++ b/backend/src/services/identity-jwt-auth/identity-jwt-auth-fns.ts
@@ -9,5 +9,5 @@ export const doesFieldValueMatchJwtPolicy = (fieldValue: string | boolean | numb
return fieldValue === parseInt(policyValue, 10);
}
- return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue);
+ return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue, { bash: true });
};
diff --git a/backend/src/services/identity-oidc-auth/identity-oidc-auth-fns.ts b/backend/src/services/identity-oidc-auth/identity-oidc-auth-fns.ts
index 8ed134cbaa..f89c5b1770 100644
--- a/backend/src/services/identity-oidc-auth/identity-oidc-auth-fns.ts
+++ b/backend/src/services/identity-oidc-auth/identity-oidc-auth-fns.ts
@@ -9,13 +9,13 @@ export const doesFieldValueMatchOidcPolicy = (fieldValue: string | number | bool
return fieldValue === parseInt(policyValue, 10);
}
- return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue);
+ return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue, { bash: true });
};
export const doesAudValueMatchOidcPolicy = (fieldValue: string | string[], policyValue: string) => {
if (Array.isArray(fieldValue)) {
- return fieldValue.some((entry) => entry === policyValue || picomatch.isMatch(entry, policyValue));
+ return fieldValue.some((entry) => entry === policyValue || picomatch.isMatch(entry, policyValue, { bash: true }));
}
- return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue);
+ return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue, { bash: true });
};
diff --git a/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-fns.ts b/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-fns.ts
index cb0a41b628..5887121acb 100644
--- a/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-fns.ts
+++ b/backend/src/services/identity-spiffe-auth/identity-spiffe-auth-fns.ts
@@ -24,7 +24,7 @@ export const doesSpiffeIdMatchPattern = (spiffeId: string, patterns: string): bo
.map((p) => p.trim())
.filter(Boolean);
- return patternList.some((pattern) => picomatch.isMatch(spiffeId, pattern));
+ return patternList.some((pattern) => picomatch.isMatch(spiffeId, pattern, { bash: true }));
};
const BUNDLE_FETCH_TIMEOUT_MS = 10_000;