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

Export to Word

Description

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

Extended Description

N/A


ThreatScore

Threat Mapped score: 1.8

Industry: Finiancial

Threat priority: P4 - Informational (Low)


Observed Examples (CVEs)

Related Attack Patterns (CAPEC)

N/A


Attack TTPs

N/A

Modes of Introduction

Phase Note
Implementation N/A

Common Consequences

Potential Mitigations

Applicable Platforms


Demonstrative Examples

Intro: The following code shows a simple example of a double free vulnerability.

Body: Double free vulnerabilities have two common (and sometimes overlapping) causes:

char* ptr = (char*)malloc (SIZE); ... if (abrt) { free(ptr); } ... free(ptr);

Intro: This code binds a server socket to port 21, allowing the server to listen for traffic on that port.

Body: 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.

void bind_socket(void) { int server_sockfd; int server_len; struct sockaddr_in server_address; /*unlink the socket if already bound to avoid an error when bind() is called*/ unlink("server_socket"); server_sockfd = socket(AF_INET, SOCK_STREAM, 0); server_address.sin_family = AF_INET; server_address.sin_port = 21; server_address.sin_addr.s_addr = htonl(INADDR_ANY); server_len = sizeof(struct sockaddr_in); bind(server_sockfd, (struct sockaddr *) &s1, server_len); }

Notes

← Back to CWE list