Reproduced Exploit
Tradable — a null Quadrata business attribute passes an Individual-only deal
When a deal requires EntityType.Individual, the verifier sets isBusiness from businessAttribute.value.isBusinessEqual(true) && !expired. A missing attribute is bytes32(0). That value is not "is business", so isBusiness is false and neither revert runs. The account is marked eligible and is paid the…
Chain
Other
Category
access-control
Date
Jul 2024
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 37958-bypass-of-entitytype-check-when-null-attribute-is-returned-b. Standalone Foundry PoC and full write-up: 37958-bypass-of-entitytype-check-when-null-attribute-is-returned-b_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/access-control/broken-logic·vuln/logic/missing-validation
Reproduction: a self-contained Foundry PoC that compiles and runs offline with only
forge-std— no fork and no RPC. Trace: output.txt. PoC: test/37958-bypass-of-entitytype-check-when-null-attribute-is-returned-b_exp.sol.
Key info#
| Impact | HIGH — an account with no business attribute receives 1,000 DEAL from an Individual-only allocation |
| Protocol | Tradable onchain v2, QuadrataKYCVerifier |
| Vulnerable code | isBusiness = isBusinessEqual(true) && !expired |
| Bug class | Null Quadrata attribute is treated as "not a business" |
| Finding | Spearbit / Cergyk — Tradable, July 2024 · id 37958 |
| Report | Tradable Spearbit review |
| Source | AuditVault finding |
| Compiler | solc 0.8.27, cancun, via IR |
TL;DR#
When a deal requires EntityType.Individual, the verifier sets isBusiness from businessAttribute.value.isBusinessEqual(true) && !expired. A missing attribute is bytes32(0). That value is not "is business", so isBusiness is false and neither revert runs. The account is marked eligible and is paid the restricted allocation.
A control verifier reverts on a null attribute, and also reverts when the attribute is an explicit business.
The vulnerable code#
bool isBusiness = reader.isBusinessEqual(businessAttribute, true) && !reader.isExpired(account); // @> VULN
if (entityType == EntityType.Individual && isBusiness) {
revert EntityTypeCheckFailed(account);
}
if (entityType == EntityType.Business && !isBusiness) {
revert EntityTypeCheckFailed(account);
}
dealToken.mint(account, ALLOCATION);
The fix is to reject a null attribute before the flag is interpreted:
bytes32 businessAttribute = reader.businessOf(account);
+require(businessAttribute != bytes32(0), "null attribute");
Attack walkthrough#
- The deal's required entity type is Individual.
- The account has a DID.
businessOfis left atbytes32(0). isBusinessEqual(true)is false, so the expiry check is skipped andisBusinessis false.- The Individual revert needs
isBusiness == true. The Business revert needs the deal to be Business. Neither fires. - The verifier mints 1,000 DEAL.
Diagrams#
Impact#
An account that never proved it is an individual takes an Individual-only deal allocation. In this reduction that is 1,000 DEAL. A business that simply omitted the attribute is treated the same way.
Sources#
- AuditVault 37958
- Spearbit Tradable review, July 2024
- Reduced from the
QuadrataKYCVerifierlines quoted in that finding (QuadrataKYCVerifier.solL138-L148). The audited repo is not public in the finding; the blamed expression is copied verbatim in behavior.
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 37958-bypass-of-entitytype-check-when-null-attribute-is-returned-b_exp (evm-hack-registry mirror).
- AuditVault finding: 37958-bypass-of-entitytype-check-when-null-attribute-is-returned-b.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.