LiveActive security incident?Get immediate response
CWE Reference

CWE-675: Multiple Operations on Resource in… | Glexia

CWE-675 (Multiple Operations on Resource in Single-Operation Context) weakness overview with consequences, detection methods, mitigations, related CVEs and MITRE…

Release 4.21weaknessDraft

Glexia's Take · Automated analysis

CWE-675: Multiple Operations on Resource in Single-Operation Context

Multiple Operations on Resource in Single-Operation Context represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.

Executive Impact

  • Other: Varies by Context: The consequences will vary depending on how the operation works. This may depend on whether the responsibility for avoiding multiple operations is placed on the developer (which may be more risky), or whether there is built-in protection to prevent multiple invocations or handle them cleanly ("no action" or some kind of error report).

Developer Pattern

CWE-675 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.

Automation confidence

high confidence from CWE-675, 4.21.

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Official CWE Definition

CWE-675: Multiple Operations on Resource in Single-Operation Context

The product performs the same operation on a resource two or more times, when the operation should only be applied once.

Type
weakness
Abstraction
Class
Status
Draft
Source
MITRE CWE definition

Developer And Remediation Guidance

How teams prevent and detect this weakness

Causes

  • The following code shows a simple example of a double free vulnerability. Double free vulnerabilities have two common (and sometimes overlapping) causes: Error conditions and other exceptional circumstances Confusion over which part of the program is responsible for freeing the memory Although some double free vulnerabilities are not much more complicated than this example, most are spread out across hundreds of lines of code or even different files. Programmers seem particularly susceptible to freeing global variables more than once.
  • This code binds a server socket to port 21, allowing the server to listen for traffic on that port. This code may result in two servers binding a socket to same port, thus receiving each other's traffic. This could be used by an attacker to steal packets meant for another process, such as a secure FTP server.

Remediation

  • Use safe APIs
  • Centralize the control
  • Add regression tests
  • Review logs and telemetry for attempted abuse

Detection

  • Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Mappings

Related CVEs, CWEs, and ATT&CK context