Skip to content
Noroxi
OSV ecosystem advisory

GHSA-mjfq-3qr2-6g84: Cosmos EVM Allows Partial Precompile State Writes

High—No exploit No fix recorded

Noroxi assessment

Priority: Monitor (action score 0/100)

  • The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
  • Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
  • No fixed version is recorded, but the references include a patch (commit or PR) link.

Low priority for now. See the fix and affected versions sections below.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: OSV

### Impact Setting lower EVM call gas allows users to partially execute precompiles and error at specific points in the precompile code without reverting the partially written state. If executed on the distribution precompile when claiming funds, it could cause funds to be transferred to a user without resetting the claimable rewards to 0. The vulnerability could also be used to cause indeterministic execution by failing at other points in the code, halting validators. Any evmOS or Cosmos EVM chain using precompiles is affected. ### Patches The vulnerability was patched by wrapping each precompile execution into an atomic function that reverts any partially committed state on error. - [evmos/os](https://github.com/evmos/os) patch file: https://drive.google.com/file/d/1LfC0WSrQOqwTOW3qfaE6t8Jqf1PLVtS_/ For chains using a different file structure, you must manually apply the diff: ### **In `x/evm/statedb.go`:** Add the following function: ```go func (s *StateDB) RevertMultiStore(cms storetypes.CacheMultiStore, events sdk.Events) { s.cacheCtx = s.cacheCtx.WithMultiStore(cms) s.writeCache = func() { // rollback the events to the ones // on the snapshot s.ctx.EventManager().EmitEvents(events) cms.Write() } } ``` ### **In `x/evm/statedb/journal.go`:** Replace the `Revert` function with the following: ```go func (pc precompileCallChange) Revert(s *StateDB) { // rollback multi store from cache ctx to the previous // state stored in the snapshot s.RevertMultiStore(pc.multiStore, pc.events) } ``` ### **In `precompiles/common/precompile.go`:** Change the function signature in `HandleGasError` to: ```go func HandleGasError(ctx sdk.Context, contract *vm.Contract, initialGas storetypes.Gas, err *error, stateDB *statedb.StateDB, snapshot snapshot) func() { ... } ``` In the `HandleGasError` function, add the following line in the switch statement in the `case storetypes.ErrorOutOfGas:` case: ```go stateDB.RevertMultiStore(snapshot.MultiStore, snapshot.Events) ``` Add the following function: ```go // RunAtomic is used within the Run function of each Precompile implementation. // It handles rolling back to the provided snapshot if an error is returned from the core precompile logic. // Note: This is only required for stateful precompiles. func (p Precompile) RunAtomic(s snapshot, stateDB *statedb.StateDB, fn func() ([]byte, error)) ([]byte, error) { bz, err := fn() if err != nil { // revert to snapshot on error stateDB.RevertMultiStore(s.MultiStore, s.Events) } return bz, err } ``` ### **All Precompiles:** Finally, in each precompile, locate the `Run` function, and wrap each switch statement and return values into `p.RunAtomic`. For example: ```go // Run executes the precompiled contract IBC transfer methods defined in the ABI. func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error) { ctx, stateDB, snapshot, method, initialGas, args, err := p.RunSetup(evm, contract, readOnly, p.IsTransaction) if err != nil { return nil, err } // This handles any out of gas errors that may occur during the execution of a precompile tx or query. // It avoids panics and returns the out of gas error so the EVM can continue gracefully. defer cmn.HandleGasError(ctx, contract, initialGas, &err, stateDB, snapshot)() // === WRAP HERE === return p.RunAtomic(snapshot, stateDB, func() ([]byte, error) { switch method.Name { // TODO Approval transactions => need cosmos-sdk v0.46 & ibc-go v6.2.0 // Authorization Methods: case exampleCase: bz, err = p.example(ctx, evm.Origin, stateDB, method, args) default: return nil, fmt.Errorf(cmn.ErrUnknownMethod, method.Name) } if err != nil { return nil, err } cost := ctx.GasMeter().GasConsumed() - initialGas if !contract.UseGas(cost) { return nil, vm.ErrOutOfGas } if err := p.AddJournalEntries(stateDB, snapshot); err != nil { return nil, err } return bz, nil }) } ``` ### Workarounds There are no workarounds for chains that make use of precompiles. A coordinated upgrade is necessary to patch the issue. ### Testing A test was introduced in the distribution precompile to ensure that partial state writes no longer occur when a lower gas amount is set.

Published
May 14, 2025
Updated
May 15, 2025
EPSS
—

Report tools

JSON

Action score

0

Monitor

Low priority for now.

CVSS
0 / 40 · —
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · —

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • No public exploit code on record
  • No fixed version yet

If any of these changes, we'll tell you in the daily email digest.

Follow GHSA-mjfq-3qr2-6g84

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits every 10 minutes on paid plans, on the hour on the free plan.

Your free account also gets you

  • CVE alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools, at most 30 a day (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools
Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
Gogithub.com/cosmos/evm

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
Gogithub.com/cosmos/evmfrom 0—
Gogithub.com/cosmos/evmfrom 0.1.0 · up to and including 0.1.0—

Same product

Go: all records

Other highest-scoring records for the same primary product.

  • GO-2026-4677Cosmos EVM: incorrect state handling during nested EVM execution paths in github.com/cosmos/evm
    0Monitor
  • GHSA-54gx-3cgr-7mfmCosmos EVM: incorrect state handling during nested EVM execution paths
    0Monitor
  • GO-2025-4041Cosmos EVM Vulnerability in github.com/cosmos/evm
    0Monitor

Published before and after this one in the same product

  • Later →GO-2025-3684May 15, 2025 · Cosmos EVM Allows Partial Precompile State Writes in github.com/cosmos/evm
    0Monitor
  • Later →GHSA-8pfh-j44r-f654Oct 21, 2025 · Cosmos EVM Vulnerability
    0Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

No fix version is recorded for this entry. Check the references for vendor advisories.

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • No user action is required.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
Integrity
Availability
Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None

CVSS vector

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N

osv

References

All records