On December 1, 2024, Spectral’s Syntax V2 bonding contract was exploited due to an infinite approval vulnerability in the AgentToken.sol
contract. The attacker leveraged a flash loan to manipulate token approvals, enabling the transfer of almost all AgentToken.sol
funds from the bonding contract, disrupting the bonding curve calculations.
By artificially reducing token balances, the attacker caused the curve to misprice tokens, allowing them to extract a disproportionately large amount of SPEC tokens from the liquidity pool. A total of 14,793 SPEC tokens, worth approximately $250,000, were drained in the attack.
Spectral is at the forefront of a decentralized revolution, envisioning a future where onchain agents are not just a luxury for the tech-savvy but an accessible tool for everyone. Their’s mission is to transform the way individuals interact with the crypto ecosystem by establishing the Onchain Agent Economy—a pioneering framework that empowers users to create, own, and govern autonomous agents capable of executing sophisticated strategies round the clock.
Vulnerable Contract: 0xD84B6CAccFCc9FA5F48c6277C40FaC0620f1d0c2
Attacker Address : 0x000000000000E921f69f1df9E0540ccdD4847A0D
Attacker Contract Address : 0x637A5Cdd63Eae6A673bE0fFbFBaf9830F905044c
Attack Transaction: 0xa3535c70c
The attacker swapped the borrowed SPEC tokens for AgentToken.sol
tokens in the AutonomousAgentDeployer.sol
contract using the swapExactSPECForTokens
function.
The attacker swapped the AgentToken.sol
back for SPEC in the AutonomousAgentDeployer.sol
contract through swapExactTokensForSPEC
.
The AutonomousAgentDeployer.sol
calls safeTransferFrom
to transfer tokens from the user to it.The attacker swapped the AgentToken.sol back for SPEC in the AutonomousAgentDeployer.sol contract through swapExactTokensForSPEC .
AgentToken.sol
is being transferred back to the AgentBalances.sol
contract, the transfer tax is applied since it is an contract.Inside the tax calculation code, a faulty line granted infinite approval of AgentToken.sol
for the AgentBalances.sol
contract. (See at line 90)
To exploit this, the attacker called the deposit function on the AgentBalances.sol contract.
AgentToken.sol
balances from AutonomousAgentDeployer.sol
to AgentBalances.sol
. This leads to the manipulation of bonding curve.AgentToken.sol
, making it appear much more valuable than it actually was.AgentToken.sol
to swap a small amount of it back for an outsized amount of SPEC tokens in the liquidity pool.The root cause of the exploit was an unintended infinite approval in the AgentToken.sol
contract during tax calculation. This approval granted the AgentBalances.sol
contract unrestricted access to spend AgentToken.sol
from the AutonomousAgentDeployer.sol
contract.
The attacker exploited this oversight to manipulate token balances, causing the bonding curve to misprice tokens and allowing them to drain liquidity.
See the funds flow here:
The team responded to the exploit quickly through their twitter(x) account.
deposit()
function on AgentBalances.sol
should have been restricted to trusted entities or removed entirely from public access, ensuring only authorized users or contracts could call it.Choosing a reputable audit firm like QuillAudits ensures that your protocol undergoes rigorous scrutiny from experienced security professionals. QuillAudits specializes in uncovering critical vulnerabilities and providing actionable remediation strategies. Our expertise helps safeguard your project from attacks, ensuring that security issues are addressed proactively.
Join 1000+ leaders who secured themselves from losing Billion Dollars.
Get Pure Alpha Straight to Your Inbox. Miss this, and you’re missing out.
Insider Secrets - Delivered Right to You. Subscribe now.