CVE-2024-42640: Angular base64 upload Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-vgxq-6rcf-qwrw
CVSS 10.0
CWE-434
Published
Advisory Summary

CVE-2024-42640 is a CRITICAL (CVSS 10.0) remote code execution vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Angular base64 upload libraries in the npm ecosystem. The issue involves angular-base64-upload vulnerable to unauthenticated remote code execution. Remediation is available by upgrading affected packages to version 0.1.21.

CVE-2024-42640 at a Glance

CVE Identifier CVE-2024-42640
GHSA Identifier GHSA-vgxq-6rcf-qwrw
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product Angular base64 upload
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-42640

To remediate this vulnerability, upgrade all affected Angular base64 upload dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

angular-base64-upload fixed: 0.1.21
npm install angular-base64-upload@0.1.21
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls angular-base64-upload

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-42640, inspect your project dependencies using npm:

npm ls angular-base64-upload

Analyze the terminal output to locate any version of Angular base64 upload in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.21), your application is affected.

Note: The npm ls angular-base64-upload command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. In Angular base64 upload, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

angular-base64-upload versions prior to v0.1.21 are vulnerable to unauthenticated remote code execution via the `angular-base64-upload/demo/server.php` endpoint. Exploitation of this vulnerability involves uploading arbitrary file content to the server, which can subsequently accessed through the `angular-base64-upload/demo/uploads` endpoint. This leads to the execution of previously uploaded content which enables the attacker to achieve code execution on the server. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.

CVE-2024-42640 Affected Angular base64 upload Versions

1 component(s)
Fixed Versions:
0.1.21
Product / Package Ecosystem Affected Versions Fixed Version
angular-base64-upload
npm
< 0.1.21
0.1.21

References

Frequently Asked Questions

What is CVE-2024-42640?
CVE-2024-42640 is a security vulnerability in Angular base64 upload involving angular-base64-upload vulnerable to unauthenticated remote code execution under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which Angular base64 upload versions are affected?
Affected versions include releases prior to 0.1.21 across affected packages: angular-base64-upload.
What version fixes CVE-2024-42640?
Upgrading to 0.1.21 (or the latest patched release for your respective branch) resolves the vulnerability.
Is angular-base64-upload affected?
Yes, angular-base64-upload is affected in releases prior to 0.1.21. Upgrade your dependency to 0.1.21 or later.
What is the CVSS score of CVE-2024-42640?
CVE-2024-42640 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-42640?
CVE-2024-42640 is classified under CWE-434: Unrestricted Upload of File with Dangerous Type (The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.).
How can I check npm dependencies for CVE-2024-42640?
Run the dependency tree command: 'npm ls angular-base64-upload'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vgxq-6rcf-qwrw",
  "modified" : "2024-10-11T19:44:05Z",
  "published" : "2024-10-11T18:32:49Z",
  "aliases" : [ "CVE-2024-42640" ],
  "summary" : "angular-base64-upload vulnerable to unauthenticated remote code execution",
  "details" : "angular-base64-upload versions prior to v0.1.21 are vulnerable to unauthenticated remote code execution via the `angular-base64-upload/demo/server.php` endpoint. Exploitation of this vulnerability involves uploading arbitrary file content to the server, which can subsequently accessed through the `angular-base64-upload/demo/uploads` endpoint. This leads to the execution of previously uploaded content which enables the attacker to achieve code execution on the server.\n\nNOTE: This vulnerability only affects products that are no longer supported by the maintainer.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "angular-base64-upload"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.21"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-42640"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/adonespitogo/angular-base64-upload"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rvizx/CVE-2024-42640"
  }, {
    "type" : "WEB",
    "url" : "https://www.zyenra.com/blog/unauthenticated-rce-in-angular-base64-upload.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-11T19:44:05Z",
    "nvd_published_at" : "2024-10-11T16:15:08Z"
  }
}