Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 7320cf4

Browse files
committed
fix: reject off-curve owners during ATA creation
1 parent 975b524 commit 7320cf4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

token/js/client/token.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,6 +2239,9 @@ export class Token {
22392239
mint: PublicKey,
22402240
owner: PublicKey,
22412241
): Promise<PublicKey> {
2242+
if (!PublicKey.isOnCurve(owner.toBuffer())) {
2243+
throw new Error(`Owner cannot sign: ${owner.toString()}`);
2244+
}
22422245
return (
22432246
await PublicKey.findProgramAddress(
22442247
[owner.toBuffer(), programId.toBuffer(), mint.toBuffer()],

0 commit comments

Comments
 (0)