CyberSecBulletin
CVE-2024-39565NVD status: Analyzed

Junos OS: Improper Neutralization of Data within XPath Expressions

CVE-2024-39565 is a high-severity improper neutralization of data within xpath expressions vulnerability in Junos OS from Juniper Networks, with a CVSS 3.1 base score of 8.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, but only if a user takes part, for example by opening a link or file. The record lists versions 21.2R3-S8, 21.4R3-S7, 22.2R3-S4 as the first without the flaw, so updating Junos OS to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.52% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Junos OS to 21.2R3-S8 or 21.4R3-S7 or 22.2R3-S4 or 22.3R3-S3, whichever matches your release line, or a later version.
  2. Update Junos to 21.2 or a later version.
  3. Read the advisory on supportportal.juniper.net for workarounds and exact fixed builds.
  4. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
  5. Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.

Affected products and versions

VendorProductAffected versionsFixed in
Juniper NetworksJunos OSbefore 21.2R3-S8; 21.4 up to, but not including, 21.4R3-S7; 22.2 up to, but not including, 22.2R3-S4; 22.3 up to, but not including, 22.3R3-S3; 22.4 up to, but not including, 22.4R3-S2; 23.2 up to, but not including, 23.2R2; 23.4 up to, but not including, 23.4R1-S1, 23.4R2; before 21.2r3-s8; and 7 more ranges21.2R3-S8, 21.4R3-S7, 22.2R3-S4, 22.3R3-S3, 22.4R3-S2, 23.2R2
Juniper NetworksJ-webNot specified in the recordNot stated
Juniper NetworksJunosbefore 21.2; 21.2; 21.4; 22.2; 22.3; 22.4; 23.2; 23.421.2

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
RequiredA user must take an action such as opening a file or link.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H. Scored by CNA (juniper.net).

Scoring systemScoreSeverityScored by
CVSS 4.07.7HighCNA (juniper.net)
CVSS 3.18.8HighCNA (juniper.net)

Official description

An Improper Neutralization of Data within XPath Expressions ('XPath Injection') vulnerability in J-Web shipped with Juniper Networks Junos OS allows an unauthenticated, network-based attacker to execute remote commands on the target device. While an administrator is logged into a J-Web session or has previously logged in and subsequently logged out of their J-Web session, the attacker can arbitrarily execute commands on the target device with the other user's credentials. In the worst case, the attacker will have full control over the device. This issue affects Junos OS: * All versions before 21.2R3-S8, * from 21.4 before 21.4R3-S7, * from 22.2 before 22.2R3-S4, * from 22.3 before 22.3R3-S3, * from 22.4 before 22.4R3-S2, * from 23.2 before 23.2R2, * from 23.4 before 23.4R1-S1, 23.4R2.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Improper Neutralization of Data within XPath Expressions

The product uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input.

How developers prevent this class of flaw

  • Use parameterized XPath queries (e.g. using XQuery). This will help ensure separation between data plane and control plane.
  • Properly validate user input. Reject data where appropriate, filter where appropriate and escape where appropriate. Make sure input that will be used in XPath queries is safe in that context.

More Improper Neutralization of Data within XPath Expressions vulnerabilities (CWE-643)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Patches and release notes

Other vulnerabilities in Junos OS

All Junos OS vulnerabilities

Spotted an error? Tell us.