CVE-2022-42118 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in com.liferay:com.liferay.portal.search.web. A fix is available for com.liferay:com.liferay.portal.search.web — see the affected versions and patch details below.
Liferay Portal and Liferay DXP Vulnerable to XSS via the Portal Search Module
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-42118.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
com.liferay:com.liferay.portal.search.web☕com.liferay.portal:release.dxp.bom☕com.liferay.portal:release.dxp.bomReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
A Cross-site scripting (XSS) vulnerability in the Portal Search module before 6.0.12 from Liferay Portal (7.1.0 through 7.4.2), and Liferay DXP 7.1 before fix pack 27, 7.2 before fix pack 15, and 7.3 before service pack 3 allows remote attackers to inject arbitrary web script or HTML via the tag parameter.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | com.liferay:com.liferay.portal.search.web | all versions | 6.0.12com.liferay:com.liferay.portal.search.web:6.0.12 |
| ☕Maven | com.liferay.portal:release.dxp.bom | ≥ 7.1.0&&< 7.1.10.fp27 | 7.1.10.fp27com.liferay.portal:release.dxp.bom:7.1.10.fp27 |
| ☕Maven | com.liferay.portal:release.dxp.bom | ≥ 7.2.0&&< 7.2.10.fp15 | 7.2.10.fp15com.liferay.portal:release.dxp.bom:7.2.10.fp15 |
Affected Products
digital experience platformliferaydxpliferayliferay portalliferayDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for com.liferay:com.liferay.portal.search.web, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update com.liferay:com.liferay.portal.search.web to 6.0.12 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-42118 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
How to detect CVE-2022-42118
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2022-42118 -u https://target- Template
- Liferay Portal - Cross-site Scripting
- Severity
- medium
- Impact
- Unauthenticated attackers can inject malicious JavaScript through the tag parameter in the Portal Search module to steal Liferay Portal user session cookies and credentials.
- Remediation
- Update to Liferay Portal 7.4.3+, DXP 7.1 fix pack 27+, DXP 7.2 fix pack 15+, or DXP 7.3 service pack 3+.
Template by ProjectDiscovery nuclei-templates (ritikchaddha), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is CVE-2022-42118 in your dependencies?
Find it across Maven, including transitive dependencies.