You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This line checks whether the sender is authorized to burn tokens. However, from_address is the payload parameter fully controlled by the sender. So this check is literally saying this: "Do you know "from_address" such that its hash(from_address, my_address) is equal to your actual address "sender_address". It seems to me that instead of provoking an attacker to guess such a payload to bypass the check, it could be better to:
precompute the wallet address as hash(sender_address, my_address(), jetton_wallet_code)
save it, and when checking for authorization, check that hash(sender_address, my_address(), jetton_wallet_code) == saved_hash
The proposed option is "something you are." Other options could include "something you know," "secret," etc.
In a nutshell:
The throw check can be bypassed if an attacker can craft the payload such that sender_address matches the calculated must_be_address = calculate_user_jetton_wallet_address(from_address, my_address(), jetton_wallet_code). What's more, it can be guessed offline.
Please correct me if I'm wrong and thank you for your time.
The text was updated successfully, but these errors were encountered:
So this check is literally saying this: "Do you know from_address such that its hash(from_address, my_address) is equal to your actual address sender_address".
the calculate_user_jetton_wallet_address(from_address, my_address(), jetton_wallet_code) is not an ordinary hash, it gives the deterministic address of the jetton wallet associated with the from_address. Hence the check says, "Are you really the jetton wallet of the person you claim".
Although by Pigeonhole Principle, it is theoretically possible to find an address of an arbitrary contract such that calculate_user_jetton_wallet_address(from_address, my_address(), jetton_wallet_code) is the contract address but it is practically impossible given the security of the hashing scheme used and the length of the address (hash) we want to brute force.
Hi everyone! I was looking at the Jetton burn function and noticed a strange authorization check. It seems to me that it could be a security issue.
token-contract/ft/jetton-minter.fc:75
This line checks whether the sender is authorized to burn tokens. However,
from_address
is the payload parameter fully controlled by the sender. So this check is literally saying this: "Do you know "from_address" such that its hash(from_address, my_address) is equal to your actual address "sender_address". It seems to me that instead of provoking an attacker to guess such a payload to bypass the check, it could be better to:The proposed option is "something you are." Other options could include "something you know," "secret," etc.
In a nutshell:
The throw check can be bypassed if an attacker can craft the payload such that sender_address matches the calculated
must_be_address = calculate_user_jetton_wallet_address(from_address, my_address(), jetton_wallet_code)
. What's more, it can be guessed offline.Please correct me if I'm wrong and thank you for your time.
The text was updated successfully, but these errors were encountered: