CWE-506
Weakness Allowed-with-ReviewEmbedded 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
Modes of introduction
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
added/updated demonstrative examples
updated Time_of_Introduction
updated Description, Relationships, Other_Notes, Taxonomy_Mappings
updated Description, Other_Notes
updated Other_Notes, Terminology_Notes
updated Common_Consequences
updated Relationships
updated Potential_Mitigations
updated Relationships
updated Detection_Factors
updated Demonstrative_Examples, Relationships
updated Relationships
updated Time_of_Introduction
updated Relationships
updated Description, Related_Attack_Patterns
updated Relationships
updated Mapping_Notes
updated Observed_Examples
updated References
updated Detection_Factors, References
updated Applicable_Platforms, Demonstrative_Examples, Relationship_Notes, Relationships, Weakness_Ordinalities
updated Potential_Mitigations
updated Background_Details, Demonstrative_Examples, Description
557 vulnerabilities reference this CWE, most recent first.
GHSA-V73M-FJXV-W4RH
Vulnerability from github – Published: 2018-07-23 20:50 – Updated: 2023-09-07 18:27The fabric-js package is a piece of malware that steals environment variables and sends them to attacker controlled locations.
All versions have been unpublished from the npm registry.
Recommendation
As this package is malware, if you find it installed in your environment, the real security concern is determining how it got there.
If you have found this 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 registry credentials, tokens, and any other sensitive credentials that may have been present in your environment variables.
Additionally, any service which may have been exposed via credentials in your environment variables, such as a database, should be reviewed for indicators of compromise as well.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "fabric-js"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.0.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2017-16053"
],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T21:57:05Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "The `fabric-js` package is a piece of malware that steals environment variables and sends them to attacker controlled locations. \n\nAll versions have been unpublished from the npm registry.\n\n\n## Recommendation\n\nAs this package is malware, if you find it installed in your environment, the real security concern is determining how it got there. \n\nIf you have found this 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 registry credentials, tokens, and any other sensitive credentials that may have been present in your environment variables. \n\nAdditionally, any service which may have been exposed via credentials in your environment variables, such as a database, should be reviewed for indicators of compromise as well.",
"id": "GHSA-v73m-fjxv-w4rh",
"modified": "2023-09-07T18:27:36Z",
"published": "2018-07-23T20:50:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-16053"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-v73m-fjxv-w4rh"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/487"
}
],
"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": "fabric-js is malware"
}
GHSA-V8G7-9QV2-J865
Vulnerability from github – Published: 2020-09-04 16:38 – Updated: 2021-10-01 20:42All 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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "bitcoin-osp"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:56:34Z",
"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-v8g7-9qv2-j865",
"modified": "2021-10-01T20:42:19Z",
"published": "2020-09-04T16:38:55Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/1365"
}
],
"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 bitcoin-osp"
}
GHSA-V95X-H953-X7FG
Vulnerability from github – Published: 2020-09-03 19:47 – Updated: 2021-09-30 20:19This package contained malicious code. The package uploaded system information such as OS and hostname to a remote server.
Recommendation
Remove the package from your environment. There are no indications of further compromise.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "k0a_multer"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:48:20Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "This package contained malicious code. The package uploaded system information such as OS and hostname to a remote server.\n\n\n## Recommendation\n\nRemove the package from your environment. There are no indications of further compromise.",
"id": "GHSA-v95x-h953-x7fg",
"modified": "2021-09-30T20:19:28Z",
"published": "2020-09-03T19:47:55Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/1130"
}
],
"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 k0a_multer"
}
GHSA-V99V-XGJX-7M7G
Vulnerability from github – Published: 2020-09-02 18:40 – Updated: 2021-10-01 14:00All versions of asnyc 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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "asnyc"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:37:59Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "All versions of `asnyc` 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-v99v-xgjx-7m7g",
"modified": "2021-10-01T14:00:55Z",
"published": "2020-09-02T18:40:47Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/847"
}
],
"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 asnyc"
}
GHSA-VCG5-9XW6-R56C
Vulnerability from github – Published: 2020-09-02 21:40 – Updated: 2021-09-30 21:55Version 2.2.0 of logsymbles contains malicious code as a preinstall script. The package is malware designed to take advantage of users making a mistake when typing the name of a module to install. When installed, the package downloads a file from a remote server, executes it and opens a backdoor.
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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "logsymbles"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:40:09Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "Version 2.2.0 of `logsymbles` contains malicious code as a preinstall script. The package is malware designed to take advantage of users making a mistake when typing the name of a module to install. When installed, the package downloads a file from a remote server, executes it and opens a backdoor.\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-vcg5-9xw6-r56c",
"modified": "2021-09-30T21:55:54Z",
"published": "2020-09-02T21:40:49Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/908"
}
],
"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 logsymbles"
}
GHSA-VF5M-Q45W-8MH9
Vulnerability from github – Published: 2020-09-03 23:00 – Updated: 2021-09-30 17:01Version 0.8.0 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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "js-qha3"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:53:40Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "Version 0.8.0 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-vf5m-q45w-8mh9",
"modified": "2021-09-30T17:01:14Z",
"published": "2020-09-03T23:00:25Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/1282"
}
],
"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 js-qha3"
}
GHSA-VF8Q-PW7H-R2X2
Vulnerability from github – Published: 2020-09-11 21:15 – Updated: 2021-09-30 22:03Version 4.13.2 of epress contains malicious code . The package is malware designed to take advantage of users making a mistake when typing the name of a module to install. Upon require the package attempts to start a cryptocurrency miner using coin-hive.
Recommendation
Remove the package from your environment and verify whether your system is running the cryptocurrency miner.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "epress"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:40:46Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "Version 4.13.2 of `epress` contains malicious code . The package is malware designed to take advantage of users making a mistake when typing the name of a module to install. Upon require the package attempts to start a cryptocurrency miner using coin-hive.\n\n\n## Recommendation\n\nRemove the package from your environment and verify whether your system is running the cryptocurrency miner.",
"id": "GHSA-vf8q-pw7h-r2x2",
"modified": "2021-09-30T22:03:15Z",
"published": "2020-09-11T21:15:54Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/925"
}
],
"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 epress"
}
GHSA-VGR2-R5HM-F6GF
Vulnerability from github – Published: 2026-02-12 22:11 – Updated: 2026-02-12 22:11This crate was used as a dependency by finch_cli_rust and finch-rst and contained a malware payload to exfiltrate credentials.
The malicious crate had 1 version published on 2025-12-08 and had been downloaded 22 times. Other than the other crates above that were part of the attack, no other crates depedended on this crate.
Thanks to Matthias Zepper of NGI Sweden for reporting this to the crates.io team!
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "sha-rst"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-12T22:11:08Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "This crate was used as a dependency by `finch_cli_rust` and `finch-rst` and contained a malware payload to exfiltrate credentials.\n\nThe malicious crate had 1 version published on 2025-12-08 and had been downloaded 22 times. Other than the other crates above that were part of the attack, no other crates depedended on this crate.\n\nThanks to Matthias Zepper of [NGI Sweden](https://ngisweden.scilifelab.se/) for reporting this to the crates.io team!",
"id": "GHSA-vgr2-r5hm-f6gf",
"modified": "2026-02-12T22:11:08Z",
"published": "2026-02-12T22:11:08Z",
"references": [
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2025-0151.html"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "`sha-rst` was removed from crates.io for malicious code"
}
GHSA-VM67-MH96-95MQ
Vulnerability from github – Published: 2020-09-03 21:40 – Updated: 2021-09-29 20:53Version 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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "bubfer-xor"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:51:41Z",
"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-vm67-mh96-95mq",
"modified": "2021-09-29T20:53:43Z",
"published": "2020-09-03T21:40:48Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/1232"
}
],
"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 bubfer-xor"
}
GHSA-VM6V-W6Q2-MRRQ
Vulnerability from github – Published: 2020-09-03 19:20 – Updated: 2021-09-30 20:09All versions of bb-builder contained malicious code. The package ran an executable targeting Windows and uploaded information to a remote server.
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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "bb-builder"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-506"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:47:54Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "All versions of `bb-builder` contained malicious code. The package ran an executable targeting Windows and uploaded information to a remote server.\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-vm6v-w6q2-mrrq",
"modified": "2021-09-30T20:09:24Z",
"published": "2020-09-03T19:20:05Z",
"references": [
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/1119"
}
],
"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 bb-builder"
}
Mitigation
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.