Audit follow-up: Page search can NPE when onlyLiveSites=true and host is unresolved
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Parent epic: #36004
Finding
When onlyLiveSites=true, page search appears to call hosts.get(contentlet.getHost()).isLive() without checking whether the host lookup returned null.
Report reference: dotCMS/src/main/java/com/dotcms/rest/api/v1/page/PageResource.java:1288-1295
Potential impact
If a page/contentlet references a deleted, null, or otherwise unresolved host, the whole page-search picker may return 500 instead of excluding that page.
Suggested validation
Create or simulate a contentlet whose host cannot be resolved, then run page search with onlyLiveSites=true.
Possible fix
Null-check the host lookup and treat unresolved / non-live hosts as excluded, for example h != null && Try.of(h::isLive).getOrElse(false).
Caveat
This was AI-found by Claude from .scratch/audit/REPORT.md. Please perform secondary validation of correctness, severity, and value before actioning.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at dotCMS/src/main/java/com/dotcms/rest/api/v1/page/PageResource.java:1288-1295 and validate the reported host lookup behavior. Create or simulate a contentlet with an unresolved host, then run page search with onlyLiveSites=true. Done means unresolved or non-live hosts are excluded without the page-search picker returning a 500.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100