Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2023-40015 — vyper

🟢 CVSS 3.7 — Low ⚠️ Exploit Public CWE-670 OSV
3.7
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Vyper: reversed order of side effects for some operations

Impact

For the following (probably non-exhaustive) list of expressions, the compiler evaluates the arguments from right to left instead of left to right.

```

  • unsafe_add
  • unsafe_sub
  • unsafe_mul
  • unsafe_div
  • pow_mod256
  • |, &, ^ (bitwise operators)
  • bitwise_or (deprecated)
  • bitwise_and (deprecated)
  • bitwise_xor (deprecated)
  • raw_call
  • <, >, <=, >=, ==, !=
  • in, not in (when lhs and rhs are enums)

```

This behaviour becomes a problem when the evaluation of one of the arguments produces side effects that other arguments depend on. The following expressions can produce side-effect:

  • state modifying external call
  • state modifying internal call
  • raw_call
  • pop() when used on a Dynamic Array stored in the storage
  • create_minimal_proxy_to
  • create_copy_of
  • create_from_blueprint

For example:

```Vyper

f:uint256

@internal

def side_effect() -> uint256:

self.f = 12

return 1

@external

def foo() -> uint256:

return unsafe_add(self.f,self.side_effect()) # returns 13 instead of 1

```

```Vyper

a:DynArray[uint256, 12]

@external

def bar() -> bool:

self.a = [1,2,3]

return len(self.a) == self.a.pop() # return false instead of true

```

Patches

not yet patched, will address in a future release. tracking in https://github.com/vyperlang/vyper/issues/3604.

Workarounds

When using expressions from the list above, make sure that the arguments of the expression do not produce side effects or, if one does, that no other argument is dependent on those side effects.

References

_Are there any links users can visit to find out more?_

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. Rated impact: confidentiality none, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Attack requirements: None — no deployment-specific condition has to hold.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Confidentiality impact: None.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

CVE-2023-40015 is classified as CWE-670: Always-Incorrect Control Flow Implementation. The control flow does not do what the logic intends, so a check never has the effect it appears to have.

Affected software

CVE-2023-40015 is recorded against 1 package.

  • vyper

Timeline and source

Published on 4 September 2023 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Web)
github.com (Web)
github.com (Package)

Other advisories for this package

vyper has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-670: Always-Incorrect Control Flow Implementation) in other software:

Details

Severity LOW
CVSS Score 3.7
CVSS Vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
CWE CWE-670
Public Exploit ⚠️ Yes
Source OSV
Published 2023-09-04
Updated 2026-08-20
Modified 2026-06-17
Fix URL N/A

Affected Packages

Software From version Fixed in
vyper — —

Similar Threats

Exploit Protection

Are you running vyper?

CVE-2023-40015 carries CVSS 3.7 Low rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2023-40015 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2023
✓