Common Weakness Enumeration

CWE-506

Weakness Allowed-with-Review

Embedded Malicious Code

Abstraction: Class · Status: Incomplete

The product contains code that appears to be malicious in nature.

Mapping guidance

This CWE entry is a Class and might have Base-level children that would be more appropriate

Examine children of this entry to see if there is a better fit

Relationships and members
ChildOf: CWE-912 · View CWE-1000
Modes of introduction
Implementation
Bundling
Distribution
Installation
Detection methods

Manual Static Analysis - Binary or Bytecode

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies

Generated Code Inspection

Effectiveness: SOAR Partial

Dynamic Analysis with Manual Results Interpretation

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Automated Monitored Execution

Effectiveness: SOAR Partial

Manual Static Analysis - Source Code

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Manual Source Code Review (not inspections)

Effectiveness: SOAR Partial

Automated Static Analysis

According to SOAR [REF-1479], the following detection techniques may be useful:

Cost effective for partial coverage:

Origin Analysis

Effectiveness: SOAR Partial

Notes

Relationship

It is suspected that malicious code can often be characterized using other "regular" weaknesses related to insecure behavior. However, this has not been closely investigated.

Terminology

The term "Trojan horse" was introduced by Dan Edwards and recorded by James Anderson [18] to characterize a particular computer security threat; it has been redefined many times [4,18-20].

Content history
Submission: Landwehr · 2006-07-19 · CWE Draft 3
Modification: Sean Eidemiller · Cigital · 2008-07-01 · CWE 1.0

added/updated demonstrative examples

Modification: Eric Dalci · Cigital · 2008-07-01 · CWE 1.0

updated Time_of_Introduction

Modification: CWE Content Team · MITRE · 2008-09-08 · CWE 1.0

updated Description, Relationships, Other_Notes, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2009-10-29 · CWE 1.6

updated Description, Other_Notes

Modification: CWE Content Team · MITRE · 2010-09-27 · CWE 1.10

updated Other_Notes, Terminology_Notes

Modification: CWE Content Team · MITRE · 2011-06-01 · CWE 1.13

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2012-05-11 · CWE 2.2

updated Relationships

Modification: CWE Content Team · MITRE · 2012-10-30 · CWE 2.3

updated Potential_Mitigations

Modification: CWE Content Team · MITRE · 2013-02-21 · CWE 2.4

updated Relationships

Modification: CWE Content Team · MITRE · 2014-07-30 · CWE 2.8

updated Detection_Factors

Modification: CWE Content Team · MITRE · 2017-11-08 · CWE 3.0

updated Demonstrative_Examples, Relationships

Modification: CWE Content Team · MITRE · 2020-02-24 · CWE 4.0

updated Relationships

Modification: CWE Content Team · MITRE · 2020-12-10 · CWE 4.3

updated Time_of_Introduction

Modification: CWE Content Team · MITRE · 2022-04-28 · CWE 4.7

updated Relationships

Modification: CWE Content Team · MITRE · 2023-01-31 · CWE 4.10

updated Description, Related_Attack_Patterns

Modification: CWE Content Team · MITRE · 2023-04-27 · CWE 4.11

updated Relationships

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes

Modification: CWE Content Team · MITRE · 2023-10-26 · CWE 4.13

updated Observed_Examples

Modification: CWE Content Team · MITRE · 2024-07-16 · CWE 4.15

updated References

Modification: CWE Content Team · MITRE · 2025-09-09 · CWE 4.18

updated Detection_Factors, References

Modification: CWE Content Team · MITRE · 2025-12-11 · CWE 4.19

updated Applicable_Platforms, Demonstrative_Examples, Relationship_Notes, Relationships, Weakness_Ordinalities

Modification: CWE Content Team · MITRE · 2026-04-30 · CWE 4.20

updated Potential_Mitigations

Modification: CWE Content Team · MITRE · 2026-10-28 · CWE 5.0

updated Background_Details, Demonstrative_Examples, Description

557 vulnerabilities reference this CWE, most recent first.

GHSA-M852-866J-69J8

Vulnerability from github – Published: 2020-09-01 20:47 – Updated: 2021-10-01 13:27
VLAI
Summary
Malicious Package in eslint-config-airbnb-standard
Details

Version 2.0.0 of eslint-config-airbnb-standard was published with a bundled version of eslint-scope that was found to contain malicious code. This code would read the users .npmrc file and send it's contents to a remote server.

Recommendation

The best course of action if you found this package installed in your environment is to revoke all your npm tokens and use a different version of the module. You can find instructions on how to do that here. https://docs.npmjs.com/getting-started/working_with_tokens#how-to-revoke-tokens

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "eslint-config-airbnb-standard"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.0.0"
            },
            {
              "fixed": "2.1.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "2.0.0"
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-31T18:32:19Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "Version 2.0.0 of `eslint-config-airbnb-standard` was published with a bundled version of `eslint-scope` that  was found to contain malicious code. This code would read the users `.npmrc` file and send it\u0027s contents to a remote server.\n\n\n## Recommendation\n\nThe best course of action if you found this package installed in your environment is to revoke all your npm tokens and use a different version of the module. You can find instructions on how to do that here. https://docs.npmjs.com/getting-started/working_with_tokens#how-to-revoke-tokens\n",
  "id": "GHSA-m852-866j-69j8",
  "modified": "2021-10-01T13:27:58Z",
  "published": "2020-09-01T20:47:01Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/675"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Malicious Package in eslint-config-airbnb-standard"
}

GHSA-M9R7-Q9FC-QWX5

Vulnerability from github – Published: 2020-09-03 17:22 – Updated: 2021-09-30 17:43
VLAI
Summary
Malicious Package in maybemaliciouspackage
Details

All versions of maybemaliciouspackage contain malicious code. The package prints the system's SSH keys to the console as a postinstall script.

Recommendation

Remove the package from your environment. There are no further signs of compromise.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "maybemaliciouspackage"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-31T18:45:10Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "All versions of `maybemaliciouspackage` contain malicious code. The package prints the system\u0027s SSH keys to the console as a postinstall script.\n\n\n## Recommendation\n\nRemove the package from your environment. There are no further signs of compromise.",
  "id": "GHSA-m9r7-q9fc-qwx5",
  "modified": "2021-09-30T17:43:47Z",
  "published": "2020-09-03T17:22:24Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/1042"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Malicious Package in maybemaliciouspackage"
}

GHSA-MC9X-V9XG-25PM

Vulnerability from github – Published: 2018-08-06 20:12 – Updated: 2023-09-12 18:43
VLAI
Summary
coffescript is malware
Details

The coffescript package is a piece of malware that steals sensitive data such as a user's private SSH key and bash history, sending them to attacker controlled locations.

All versions have been unpublished from the npm registry.

Recommendation

If you have found coffescript installed in your environment, you should: 1. Delete the package 2. Clear your npm cache 3. Ensure it is not present in any other package.json files on your system 4. Regenerate your SSH keys, registry credentials, tokens, and any other sensitive credentials that may have been present in your bash history.

Additionally, any service which may have been exposed via credentials in your bash history or accessible via your ssh keys, such as a database, should be reviewed for indicators of compromise as well.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "coffescript"
      },
      "versions": [
        "1.0.1"
      ]
    }
  ],
  "aliases": [
    "CVE-2017-16205"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:45:52Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "The `coffescript` package is a piece of malware that steals sensitive data such as a user\u0027s private SSH key and bash history, sending them to attacker controlled locations. \n\nAll versions have been unpublished from the npm registry.\n\n\n\n## Recommendation\n\nIf you have found `coffescript` installed in your environment, you should:\n1. Delete the package\n2. Clear your npm cache\n3. Ensure it is not present in any other package.json files on your system\n4. Regenerate your SSH keys, registry credentials, tokens, and any other sensitive credentials that may have been present in your bash history.\n\nAdditionally, any service which may have been exposed via credentials in your bash history or accessible via your ssh keys, such as a database, should be reviewed for indicators of compromise as well.",
  "id": "GHSA-mc9x-v9xg-25pm",
  "modified": "2023-09-12T18:43:18Z",
  "published": "2018-08-06T20:12:54Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2017-16205"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-mc9x-v9xg-25pm"
    },
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/542"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "coffescript is malware"
}

GHSA-MFC2-93PR-JF92

Vulnerability from github – Published: 2020-10-01 17:10 – Updated: 2020-10-01 17:09
VLAI
Summary
Malicious code in `loadyaml`
Details

npm packages loadyaml and electorn were removed from the npm registry for containing malicious code. Upon installation the package runs a preinstall script that writes a public comment on GitHub containing the following information: - IP and IP-based geolocation - home directory name - local username

The malicious packages have been removed from the npm registry and the leaked content removed from GitHub.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "loadyaml"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "1.0.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-10-01T17:09:29Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "npm packages `loadyaml` and `electorn` were removed from the npm registry for containing malicious code. Upon installation the package runs a preinstall script that writes a public comment on GitHub containing the following information:\n- IP and IP-based geolocation\n- home directory name\n- local username \n\nThe malicious packages have been removed from the npm registry and the leaked content removed from GitHub.",
  "id": "GHSA-mfc2-93pr-jf92",
  "modified": "2020-10-01T17:09:29Z",
  "published": "2020-10-01T17:10:15Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/1563"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [],
  "summary": "Malicious code in `loadyaml`"
}

GHSA-MGFF-XPG3-3GWC

Vulnerability from github – Published: 2020-09-03 19:42 – Updated: 2021-10-01 20:57
VLAI
Summary
Malicious Package in bsae-x
Details

All versions of this package contained malware. The package was designed to find and exfiltrate cryptocurrency wallets.

Recommendation

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer.

The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "bsae-x"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-31T18:57:09Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "All versions of this package contained malware. The package was designed to find and exfiltrate cryptocurrency wallets.\n\n\n## Recommendation\n\nAny computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer.\n\nThe package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.",
  "id": "GHSA-mgff-xpg3-3gwc",
  "modified": "2021-10-01T20:57:02Z",
  "published": "2020-09-03T19:42:25Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/1380"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Malicious Package in bsae-x"
}

GHSA-MH6F-8J2X-4483

Vulnerability from github – Published: 2018-11-26 23:58 – Updated: 2021-09-15 20:08
VLAI
Summary
Critical severity vulnerability that affects event-stream and flatmap-stream
Details

The NPM package flatmap-stream is considered malicious. A malicious actor added this package as a dependency to the NPM event-stream package in version 3.3.6. Users of event-stream are encouraged to downgrade to the last non-malicious version, 3.3.4, or upgrade to the latest 4.x version.

Users of flatmap-stream are encouraged to remove the dependency entirely.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "event-stream"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.3.6"
            },
            {
              "fixed": "4.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "3.3.6"
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "flatmap-stream"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:46:17Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "The NPM package `flatmap-stream` is considered malicious.  A malicious actor added this package as a dependency to the NPM `event-stream` package in version `3.3.6`.  Users of `event-stream` are encouraged to downgrade to the last non-malicious version, `3.3.4`, or upgrade to the latest  4.x version. \n\nUsers of `flatmap-stream` are encouraged to remove the dependency entirely.\n",
  "id": "GHSA-mh6f-8j2x-4483",
  "modified": "2021-09-15T20:08:26Z",
  "published": "2018-11-26T23:58:21Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/dominictarr/event-stream/issues/116"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-mh6f-8j2x-4483"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/dominictarr/event-stream"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Critical severity vulnerability that affects event-stream and flatmap-stream"
}

GHSA-MHXG-PR3J-V9GR

Vulnerability from github – Published: 2020-09-03 19:41 – Updated: 2021-10-01 20:59
VLAI
Summary
Malicious Package in colne
Details

All versions of this package contained malware. The package was designed to find and exfiltrate cryptocurrency wallets.

Recommendation

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer.

The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "colne"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-31T18:57:23Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "All versions of this package contained malware. The package was designed to find and exfiltrate cryptocurrency wallets.\n\n\n## Recommendation\n\nAny computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer.\n\nThe package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.",
  "id": "GHSA-mhxg-pr3j-v9gr",
  "modified": "2021-10-01T20:59:03Z",
  "published": "2020-09-03T19:41:22Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/1386"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Malicious Package in colne"
}

GHSA-MMPH-WP49-R48H

Vulnerability from github – Published: 2020-09-02 20:20 – Updated: 2021-10-01 14:02
VLAI
Summary
Malicious Package in experss
Details

All versions of experss typosquatted a popular package of similar name and tracked users who had installed the incorrect package. The package uploaded information to a remote server including: name of the downloaded package, name of the intended package, the Node version and whether the process was running as sudo. There is no further compromise.

Recommendation

Remove the package from your dependencies and always ensure package names are typed correctly upon installation.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "experss"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-31T18:38:11Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "All versions of `experss` typosquatted a popular package of similar name and tracked users who had installed the incorrect package. The package uploaded information to a remote server including: name of the downloaded package, name of the intended package, the Node version and whether the process was running as sudo. There is no further compromise.\n\n\n## Recommendation\n\nRemove the package from your dependencies and always ensure package names are typed correctly upon installation.",
  "id": "GHSA-mmph-wp49-r48h",
  "modified": "2021-10-01T14:02:46Z",
  "published": "2020-09-02T20:20:26Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/852"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Malicious Package in experss"
}

GHSA-MP55-2274-4PJ8

Vulnerability from github – Published: 2020-09-03 21:54 – Updated: 2021-09-29 21:03
VLAI
Summary
Malicious Package in buffer-xgr
Details

Version 2.0.2 contained malicious code. The package targeted the Ethereum cryptocurrency and performed transactions to wallets not controlled by the user.

Recommendation

Remove the package from your environment. Ensure no Ethereum funds were compromised.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "buffer-xgr"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-31T18:52:08Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "Version 2.0.2 contained malicious code. The package targeted the Ethereum cryptocurrency and performed transactions to wallets not controlled by the user.\n\n\n## Recommendation\n\nRemove the package from your environment. Ensure no Ethereum funds were compromised.",
  "id": "GHSA-mp55-2274-4pj8",
  "modified": "2021-09-29T21:03:38Z",
  "published": "2020-09-03T21:54:09Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/1244"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Malicious Package in buffer-xgr"
}

GHSA-MQ9H-CWC2-6J5R

Vulnerability from github – Published: 2020-09-03 17:42 – Updated: 2021-09-30 19:50
VLAI
Summary
Malicious Package in midway-dataproxy
Details

All versions of midway-dataproxy contain malicious code. The package uploads system information to a remote server, downloads a file and executes it.

Recommendation

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer.

The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "midway-dataproxy"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-506"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-08-31T18:45:42Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "All versions of `midway-dataproxy` contain malicious code. The package uploads system information to a remote server, downloads a file and executes it.\n\n\n## Recommendation\n\nAny computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer.\n\nThe package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.",
  "id": "GHSA-mq9h-cwc2-6j5r",
  "modified": "2021-09-30T19:50:21Z",
  "published": "2020-09-03T17:42:27Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/advisories/1056"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Malicious Package in midway-dataproxy"
}

Mitigation
Implementation Operation

Remove the malicious code and start an effort to ensure that no more malicious code exists. This may require a detailed review of all code, as it is possible to hide a serious attack in only one or two lines of code. These lines may be located almost anywhere in an application and may have been intentionally obfuscated by the attacker.

CAPEC-442: Infected Software

An adversary adds malicious logic, often in the form of a computer virus, to otherwise benign software. This logic is often hidden from the user of the software and works behind the scenes to achieve negative impacts. Many times, the malicious logic is inserted into empty space between legitimate code, and is then called when the software is executed. This pattern of attack focuses on software already fielded and used in operation as opposed to software that is still under development and part of the supply chain.

CAPEC-448: Embed Virus into DLL

An adversary tampers with a DLL and embeds a computer virus into gaps between legitimate machine instructions. These gaps may be the result of compiler optimizations that pad memory blocks for performance gains. The embedded virus then attempts to infect any machine which interfaces with the product, and possibly steal private data or eavesdrop.

CAPEC-636: Hiding Malicious Data or Code within Files

Files on various operating systems can have a complex format which allows for the storage of other data, in addition to its contents. Often this is metadata about the file, such as a cached thumbnail for an image file. Unless utilities are invoked in a particular way, this data is not visible during the normal use of the file. It is possible for an attacker to store malicious data or code using these facilities, which would be difficult to discover.