Skip to content

Commit 9486b37

Browse files
authored
feat: prevent passing in role claim in presigned URL JWTs (#520)
1 parent f6d2fbc commit 9486b37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/storage/object.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ export class ObjectStorage {
540540
return all
541541
}, metadata || {})
542542

543+
// security-in-depth: as signObjectUrl could be used as a signing oracle,
544+
// make sure it's never able to specify a role JWT claim
545+
delete metadata['role']
546+
543547
const urlParts = url.split('/')
544548
const urlToSign = decodeURI(urlParts.splice(3).join('/'))
545549
const { secret: jwtSecret } = await getJwtSecret(this.db.tenantId)

0 commit comments

Comments
 (0)