Skip to content

Commit 8442b93

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(redaction): anchor workflow token allowlist
1 parent 74ad283 commit 8442b93

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ describe('isSensitiveKey', () => {
111111
it.concurrent('should match ssh passphrases', () => {
112112
expect(isSensitiveKey('passphrase')).toBe(true)
113113
})
114+
115+
it.concurrent('should not allow arbitrary keys ending in workflow token names', () => {
116+
expect(isSensitiveKey('asyncToken')).toBe(true)
117+
expect(isSensitiveKey('homepageToken')).toBe(true)
118+
})
114119
})
115120

116121
describe('non-sensitive keys (no false positives)', () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const TRUNCATED_MARKER = '[TRUNCATED]'
1515
* idempotency keys stay visible so users can pass them into subsequent steps.
1616
*/
1717
const NON_SENSITIVE_TOKEN_KEY_PATTERNS: RegExp[] = [
18-
/(?:page|pagination|continuation|cursor|scroll|sync)[_-]?token$/i,
18+
/^(?:[A-Za-z0-9_-]+\.)*(?:(?:next|previous|after|before)[_-]?)?(?:page|pagination|continuation|cursor|scroll|sync)[_-]?token$/i,
1919
/^(?:next|previous|after|before)[_-]?token$/i,
2020
/^(?:client[_-]?request|idempotency)[_-]?token$/i,
2121
/^subjectFromWebIdentityToken$/i,

0 commit comments

Comments
 (0)