Skip to content

Commit 328b5c9

Browse files
committed
1 parent e0dffc0 commit 328b5c9

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

advisories/unreviewed/2026/04/GHSA-x4xq-7w28-q486/GHSA-x4xq-7w28-q486.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-x4xq-7w28-q486",
4-
"modified": "2026-04-08T15:31:43Z",
4+
"modified": "2026-04-08T15:32:45Z",
55
"published": "2026-04-07T18:31:37Z",
66
"aliases": [
77
"CVE-2026-4931"
88
],
9-
"details": "Smart contract Marginal v1 performs unsafe downcast, allowing attackers to settle a large debt position for a negligible asset cost.",
10-
"severity": [
9+
"summary": "MarginalProtocol Marginal v1: Unsafe uint128 downcast in adjust() enables flash loan exploit to settle large debt for negligible cost",
10+
"details": "Ecosystem: EVM (Solidity) — Ethereum mainnet smart contract. No applicable ecosystem\noption exists in the GitHub Advisory Database for on-chain Solidity contracts.\n\nIn MarginalProtocol Marginal v1, the adjust() function in MarginalV1Pool (proxy:\n0x3A6C55Ce74d940A9B5dDDE1E57eF6e70bC8757A7) performs an unsafe downcast of margin0\n(a uint256) to uint128 without overflow validation:\n\n position.margin = uint128(margin0);\n\nIn Solidity, explicit casts do not revert on overflow. When margin0 exceeds\ntype(uint128).max, the upper bits are silently discarded via a bitwise AND operation.\nThe deployed bytecode confirms this at program counter 0x069c:\n\n 0687 | PUSH20(0xffffffffffffffffffffffffffffffff)\n 069c | AND -- uint128 truncation, no overflow check\n\nNo GT opcode. No REVERT. The truncation is unconditional and silent.\n\nAn attacker takes out a flash loan to cause margin0 to exceed 2^128 - 1, silently\ntruncating the stored margin value. This allows the attacker to settle a large debt\nposition for a negligible asset cost (demonstrated at 57,005 wei), effectively draining\ncollateral from liquidity providers. No privileges are required; the attack is executable\natomically within a single transaction. The vulnerability was patched by replacing the\nbare downcast with OpenZeppelin's SafeCast.toUint128().",
11+
"severity": [],
12+
"affected": [
1113
{
12-
"type": "CVSS_V3",
13-
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N"
14+
"package": {
15+
"ecosystem": "GitHub Actions",
16+
"name": ""
17+
},
18+
"ranges": [
19+
{
20+
"type": "ECOSYSTEM",
21+
"events": [
22+
{
23+
"introduced": "0"
24+
}
25+
]
26+
}
27+
]
1428
}
1529
],
16-
"affected": [],
1730
"references": [
1831
{
19-
"type": "ADVISORY",
32+
"type": "PACKAGE",
2033
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-4931"
2134
},
2235
{
@@ -44,7 +57,7 @@
4457
"cwe_ids": [
4558
"CWE-681"
4659
],
47-
"severity": "MODERATE",
60+
"severity": "CRITICAL",
4861
"github_reviewed": false,
4962
"github_reviewed_at": null,
5063
"nvd_published_at": "2026-04-07T16:16:30Z"

0 commit comments

Comments
 (0)