The transferFrom function of a smart contract implementation for FuturXE (FXE), an Ethereum ERC20 token, allows attackers to accomplish an…
mitre·CWE-20·Published 2018-06-11
The transferFrom function of a smart contract implementation for FuturXE (FXE), an Ethereum ERC20 token, allows attackers to accomplish an unauthorized transfer of digital assets because of a logic error. The developer messed up with the boolean judgment - if the input value is smaller than or equal to allowed value, the transfer session would stop execution by returning false. This makes no sense, because the transferFrom() function should require the transferring value to not exceed the allowed value in the first place. Suppose this function asks for the allowed value to be smaller than the input. Then, the attacker could easily ignore the allowance: after this condition, the `allowed[from][msg.sender] -= value;` would cause an underflow because the allowed part is smaller than the value. The attacker could transfer any amount of FuturXe tokens of any accounts to an appointed account (the `_to` address) because the allowed value is initialized to 0, and the attacker could bypass this restriction even without the victim's private key.
The transferFrom function of a smart contract implementation for FuturXE (FXE), an Ethereum ERC20 token, allows attackers to accomplish an unauthorized transfer of digital assets because of a logic error. The developer messed up with the boolean judgment - if the input value is smaller than or equal to allowed value, the transfer session would stop execution by returning false. This makes no sense, because the transferFrom() function should require the transferring value to not exceed the allowed value in the first place. Suppose this function asks for the allowed value to be smaller than the input. Then, the attacker could easily ignore the allowance: after this condition, the `allowed[from][msg.sender] -= value;` would cause an underflow because the allowed part is smaller than the value. The attacker could transfer any amount of FuturXe tokens of any accounts to an appointed account (the `_to` address) because the allowed value is initialized to 0, and the attacker could bypass this restriction even without the victim's private key.
La función transferFrom de una implementación de contrato inteligente para FuturXE (FXE), un token Ethereum ERC20, permite a los atacantes realizar una transferencia no autorizada de activos digitales debido a un error lógico. El desarrollador se equivocó con el juicio boleano - si el valor de entrada es menor o igual al valor permitido, la sesión de transferencia detendría la ejecución devolviendo el valor "false". Esto no tiene sentido, porque la función transferFrom() debería requerir que el valor de transferencia no exceda el valor permitido en primer lugar. Supongamos que esta función pide que el valor permitido sea menor que la entrada. Entonces, el atacante podría ignorar fácilmente el permiso: después de esta condición, el "allowed[from][msg.sender] -= value;" originaría un flujo inferior porque la parte permitida es menor que el valor. El atacante podría transferir cualquier cantidad de tokens de FuturXe de cualquier cuenta a una cuenta designada (la dirección "_to") porque el valor permitido se inicializa a 0 y el atacante podría omitir esta restricción incluso sin la clave privada de la víctima.
| Version | Type | Source | Base | Exp | Impact | Vector |
|---|---|---|---|---|---|---|
| 2.0 | Primary | NVD | 5.0 | 10.0 | 2.9 | AV:N/AC:L/Au:N/C:N/I:P/A:N |
| 3.0 | Primary | NVD | 7.5 | 3.9 | 3.6 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |