T0129 - Typosquatting

Typosquatting is an attack technique where an attacker creates a package or container with a name that is very similar to a legitimate one, in hopes that a user will make a typo and download the malicious package or container. For example, if a legitimate package is named "numpy," an attacker might create a package named "numpyy" or "numpi" in hopes that a user will accidentally install the malicious package instead. In container security, it involves creating a container image with a similar name to a legitimate one, while in open-source security, it involves creating a malicious package with a similar name to a legitimate one. Once the user installs the malicious package or container, the attacker can potentially gain access to the user's system or data, or inject malicious code into the user's environment.

ID: T0129
Type: Technique
Tactic: Initial Access
Summary: Typosquatting
State: draft

Mitigations

id

type

summary

description

M1290
Mitigation
Double-checking package or container names
Users should carefully review package or container names before downloading or installing them, and ensure they are spelled correctly. Double-checking the names can help identify any typos or subtle differences that may indicate a malicious package or container.
M1291
Mitigation
Verify package or container sources
Users should only download packages or containers from trusted sources, such as official repositories or trusted vendors. Avoid downloading packages or containers from unknown or suspicious sources, as they may be more prone to typosquatting attacks
M1500
Mitigation
Verify third-party artifacts and open-source libraries
Verify third-party artifacts used in code are trusted and have not been infected by a malicious actor before use. This can be accomplished, for example, by comparing the checksum of the dependency to its checksum in a trusted source. If a difference arises, this may be a sign that someone interfered and added malicious code. If this dependency is used, it will infect the environment and could end in a massive breach, leaving the organization exposed to data leaks and more.
M1502
Mitigation
Define trusted package managers and repositories
When pulling a package by name, the package manager might look for it in several package registries, some of which may be untrusted or badly configured. If the package is pulled from such a registry, there is a higher likelihood that it could prove malicious. In order to avoid this, configure packages to be pulled from trusted package registries.
M1503
Mitigation
Implement SCA analysis
Component Analysis is the process of identifying potential areas of risk from the use of third-party and open-source software and hardware components. The best option for implementing SCA analysis is integration of SCA analysis tools into your CI/CD environment in order to scan your source code dependencies before the release.

Detections

id

type

summary

description

D1500
Detection
Configure monitoring of used artifacts and open-source libraries
Implement regular scanning of used artifacts and open-source libraries for known vulnerabilities. Set up monitoring of reported issues based on regular scanning results.
D1510
Detection
Implement Intrusion Detection System and anti-malware
An intrusion detection system (IDS) is a security tool designed to detect and alert on unauthorized access to a computer system or network. Implementing intrusion detection systems (IDS) and anti-malware software can help to identify and block malicious activity. IDS is a critical security tool that helps organizations to detect and respond to security incidents in a timely manner. By providing real-time monitoring and analysis of network traffic, IDS can help organizations to stay ahead of potential threats and reduce the risk of a security breach.
D1520
Detection
Implement endpoint detection and response system
An endpoint detection and response (EDR) system is a security tool designed to detect and respond to security incidents on endpoints, such as desktops, laptops, servers, and mobile devices. There are several reasons why an EDR system is essential for maintaining the security of endpoints: 1. Threat Detection: EDR can detect and alert on a wide range of threats, including malware, ransomware, and other types of attacks that may not be detected by traditional antivirus software. 2. Rapid Incident Response: EDR can help security teams to rapidly detect, investigate, and respond to security incidents on endpoints. EDR systems can provide detailed information about the scope and impact of an attack, enabling security personnel to respond quickly and effectively. 3. Behavioral Analysis: EDR can monitor endpoint behavior to detect and alert on suspicious or anomalous activity. This helps security teams to identify and respond to threats that may be missed by traditional signature-based detection. 4. Endpoint Visibility: EDR provides visibility into endpoint activity, including processes, network connections, and file activity. This helps security teams to identify potential attack vectors and take proactive measures to prevent future incidents.

References

  1. https://bytesafe.dev/posts/understanding-typosquatting-methods/
  2. https://cycode.com/typosquatting-repojacking-domain-takeover/
  3. https://www.reversinglabs.com/blog/beware-impostor-http-libraries-lurk-on-pypi