CVE-2021-3918:Prototype Pollution vulnerability in json-schema library allows attackers to modify JavaScript object prototypes.

splash
Back

Description Preview

CVE-2021-3918 affects the json-schema library, which is vulnerable to Prototype Pollution (CWE-1321). This security flaw allows attackers to inject properties into JavaScript object prototypes, potentially leading to application crashes, logic bypasses, or remote code execution. The vulnerability occurs because the library improperly handles object property modifications, allowing malicious actors to modify the behavior of all objects in the application.

Overview

The json-schema library contains a Prototype Pollution vulnerability that can be exploited when processing untrusted JSON schema data. When the library processes specially crafted JSON inputs, it can inadvertently allow modifications to the Object prototype, which affects all JavaScript objects in the application. This vulnerability can lead to various security issues including:

  • Application crashes
  • Bypassing security validations
  • Potential remote code execution in certain contexts
  • Unexpected application behavior
  • Data corruption or information leakage

The issue is classified as CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes), which is a common vulnerability pattern in JavaScript applications.

Remediation

To remediate this vulnerability, developers should:

  1. Update to a patched version of the json-schema library that includes the fix from commit 22f146111f541d9737e832823699ad3528ca7741.

  2. If updating is not immediately possible, implement input validation to reject any JSON schemas that contain suspicious properties like "proto", "constructor", or "prototype".

  3. Consider implementing Object.freeze(Object.prototype) in your application to prevent prototype modifications, though this may cause compatibility issues with some libraries.

  4. Review your application for any instances where untrusted data is processed by json-schema and ensure proper validation is in place.

  5. Monitor for any unusual application behavior that could indicate exploitation of this vulnerability.

References

  1. Patch commit: https://github.com/kriszyp/json-schema/commit/22f146111f541d9737e832823699ad3528ca7741
  2. Vulnerability details and exploit: https://huntr.dev/bounties/bb6ccd63-f505-4e3a-b55f-cd2662c261a9
  3. Debian security advisory: https://lists.debian.org/debian-lts-announce/2022/12/msg00013.html
  4. NetApp security advisory: https://security.netapp.com/advisory/ntap-20250117-0004/
  5. CWE-1321 details: https://cwe.mitre.org/data/definitions/1321.html

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Manufacturing
    Manufacturing
  2. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  3. Public Administration
    Public Administration
  4. Retail Trade
    Retail Trade
  5. Health Care & Social Assistance
    Health Care & Social Assistance
  6. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  7. Finance and Insurance
    Finance and Insurance
  8. Management of Companies & Enterprises
    Management of Companies & Enterprises
  9. Educational Services
    Educational Services
  10. Transportation & Warehousing
    Transportation & Warehousing
  11. Other Services (except Public Administration)
    Other Services (except Public Administration)
  12. Accommodation & Food Services
    Accommodation & Food Services
  13. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services
  14. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  15. Construction
    Construction
  16. Information
    Information
  17. Mining
    Mining
  18. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  19. Utilities
    Utilities
  20. Wholesale Trade
    Wholesale Trade

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background
Armis Vulnerability Intelligence Database