Skip to content

Latest commit

 

History

History
90 lines (76 loc) · 7.36 KB

File metadata and controls

90 lines (76 loc) · 7.36 KB

Attack Tree Analysis for microsoft/vcpkg

Objective: Execute Arbitrary Code on Application Host via vcpkg

Attack Tree Visualization

Goal: Execute Arbitrary Code on Application Host via vcpkg ├── 1. Compromise a vcpkg Port (Package) [HIGH-RISK] │ ├── 1.1. Supply Chain Attack on Upstream Source [HIGH-RISK] │ │ ├── 1.1.1. Compromise Upstream Source Repository (e.g., GitHub, GitLab) [CRITICAL] │ │ │ ├── 1.1.1.1. Stolen Credentials of Upstream Maintainer [HIGH-RISK] │ │ │ └── 1.1.1.3. Social Engineering of Upstream Maintainer [HIGH-RISK] │ │ ├── 1.2.1. Bypass vcpkg Port Review Process [CRITICAL] │ │ │ └── 1.2.1.3. Submit Obfuscated Malicious Code [HIGH-RISK] │ └── 1.3. Create a Typosquatting Port [HIGH-RISK] │ └── 1.3.1.1. User Installs Typosquatting Package by Mistake [HIGH-RISK] ├── 3. Misconfiguration of vcpkg [HIGH-RISK] │ ├── 3.1. Using an Outdated vcpkg Version [HIGH-RISK] │ │ └── 3.1.1. Known Vulnerabilities in Older vcpkg Versions [HIGH-RISK] │ ├── 3.3. Ignoring vcpkg Security Warnings/Recommendations [HIGH-RISK] │ │ └── 3.3.1. Disabling Security Features (e.g., Binary Caching Validation) [HIGH-RISK] │ ├── 3.4. Using Unverified/Untrusted Registries [HIGH-RISK] │ │ └── 3.4.1. Downloading Packages from Malicious Registries [HIGH-RISK] └── 4. Exploit Vulnerabilities in Installed Packages (Post-Installation) [HIGH-RISK] └── 4.1. Known Vulnerabilities in Installed Libraries [HIGH-RISK] [CRITICAL] └── 4.1.1. Failure to Update Dependencies Regularly [HIGH-RISK] └── 4.1.1.1. Application Uses Vulnerable Version of a Library [HIGH-RISK]

  • Description: This is the overarching category for attacks that target the packages managed by vcpkg. The attacker aims to introduce malicious code into a package that will then be installed by users.
  • Sub-Vectors:
    • 1.1. Supply Chain Attack on Upstream Source [HIGH-RISK]:

      • Description: Attacks targeting the original source code of the library before it's packaged for vcpkg.
      • Sub-Vectors:
        • 1.1.1. Compromise Upstream Source Repository (e.g., GitHub, GitLab) [CRITICAL]:
          • Description: Gaining full control over the repository where the library's source code is hosted. This allows the attacker to modify the code directly.
          • Sub-Vectors:
            • 1.1.1.1. Stolen Credentials of Upstream Maintainer [HIGH-RISK]:
              • Description: Obtaining the username and password (or other authentication tokens) of a maintainer with write access to the repository. This could be achieved through phishing, credential stuffing, or other credential theft techniques.
            • 1.1.1.3. Social Engineering of Upstream Maintainer [HIGH-RISK]:
              • Description: Tricking a maintainer into granting access to the repository or revealing sensitive information. This could involve impersonation, pretexting, or other social engineering tactics.
    • 1.2.1. Bypass vcpkg Port Review Process [CRITICAL]:

      • Description: Circumventing the checks and reviews that are in place to prevent malicious code from being added to the official vcpkg ports repository.
      • Sub-Vectors: * 1.2.1.3. Submit Obfuscated Malicious Code [HIGH-RISK]:
        • Description: Writing malicious code in a way that is difficult to understand or detect during code review. This could involve using complex logic, unusual coding patterns, or encoding techniques.
    • 1.3. Create a Typosquatting Port [HIGH-RISK]:

      • Description: Creating a malicious package with a name that is very similar to a popular, legitimate package. This relies on users making typographical errors when installing packages.
      • Sub-Vectors:
        • 1.3.1.1. User Installs Typosquatting Package by Mistake [HIGH-RISK]:
          • Description: The final step in the typosquatting attack, where a user accidentally installs the malicious package instead of the intended one.
  • Description: This category covers vulnerabilities that arise from incorrect or insecure configurations of vcpkg itself.
  • Sub-Vectors:
    • 3.1. Using an Outdated vcpkg Version [HIGH-RISK]:

      • Description: Failing to update vcpkg to the latest version, leaving it vulnerable to known security flaws.
      • Sub-Vectors:
        • 3.1.1. Known Vulnerabilities in Older vcpkg Versions [HIGH-RISK]:
          • Description: Specific vulnerabilities that have been publicly disclosed and patched in newer versions of vcpkg. Attackers can easily exploit these known vulnerabilities if the user hasn't updated.
    • 3.3. Ignoring vcpkg Security Warnings/Recommendations [HIGH-RISK]:

      • Description: Disregarding security best practices and recommendations provided by the vcpkg developers.
      • Sub-Vectors:
        • 3.3.1. Disabling Security Features (e.g., Binary Caching Validation) [HIGH-RISK]:
          • Description: Turning off security features that are designed to protect against malicious packages or compromised builds. For example, disabling binary caching validation would allow the use of potentially tampered-with pre-built binaries.
    • 3.4. Using Unverified/Untrusted Registries [HIGH-RISK]:

      • Description: Configuring vcpkg to download packages from sources that are not officially vetted or trusted.
      • Sub-Vectors:
        • 3.4.1. Downloading Packages from Malicious Registries [HIGH-RISK]:
          • Description: Actually downloading and installing packages from a registry that is controlled by an attacker or contains compromised packages.
  • Description: This category covers vulnerabilities that exist within the libraries and dependencies that are installed after vcpkg has done its job.
  • Sub-Vectors:
    • 4.1. Known Vulnerabilities in Installed Libraries [HIGH-RISK] [CRITICAL]:
      • Description: Vulnerabilities that have been publicly disclosed in the libraries that are used by the application.
      • Sub-Vectors:
        • 4.1.1. Failure to Update Dependencies Regularly [HIGH-RISK]:
          • Description: Not keeping the installed libraries up-to-date with the latest security patches.
          • Sub-Vectors:
            • 4.1.1.1. Application Uses Vulnerable Version of a Library [HIGH-RISK]:
              • Description: The direct consequence of not updating dependencies – the application is running code that contains known vulnerabilities.