Repository navigation
Verify reachability of three legacy factory query methods and decide whether to remove them #38013
Copy link
Copy link
Open
Open
Spike
Copy link
Labels
CVSS 4.0 : N/ACVSS 4.0: not a vulnerabilityCVSS 4.0: not a vulnerabilityTeam : SecurityIssues related to security and privacyIssues related to security and privacyType : Spikea time boxed issue to answer question(s)a time boxed issue to answer question(s)dotCMS : Technical DebtDealing with long standing tech debtDealing with long standing tech debt
Description
Research Question
Three public static methods build their query by concatenating a caller-supplied value into the statement text:
| Method | File | Lines |
|---|---|---|
getLinkByCondition(String) |
dotCMS/src/main/java/com/dotmarketing/portlets/links/factories/LinkFactory.java |
143-153 |
getContainerByCondition(String) |
dotCMS/src/main/java/com/dotmarketing/portlets/containers/factories/ContainerFactory.java |
55-65 |
deleteMultiTreesForInodes(List<String>) |
dotCMS/src/main/java/com/dotmarketing/factories/MultiTreeFactory.java |
492-498 |
They look removable, but the evidence is not yet conclusive. This spike establishes whether they are reachable and recommends what to do with them.
Timebox
4h
Acceptance Criteria
- Confirm whether a
.jsp_nocompfile can be served or compiled in any supported deployment.WEB-INF/web.xml:698maps the JSP servlet to*.jsponly, so the expectation is no — the deliverable is confirming it, including what the default servlet returns for a direct GET. - Confirm whether any build, packaging or upgrade step renames
.jsp_nocompfiles back to.jsp. - Establish whether the three methods have any reachable caller, searching with no file-extension filter across Java, enterprise, JSP, VTL, XML, JS and any other packaged resource.
- State whether
MaintenanceUtil.DBSearchAndReplace(reached byPOST /v1/maintenance/_searchAndReplaceand by the DWR pathAssetsSearchAndReplaceAjax) covers what the parkedSearchAndReplace.jsp_nocompdid for links and containers, or whether something was lost in that migration. - Review the remaining 8
.jsp_nocompfiles (863 lines across all 9) and report whether any other production code exists only to serve them. - Recommend one outcome per method, with its rationale: remove, deprecate for removal, or keep.
- If removal is recommended, state what happens to the parked JSPs that reference the methods, and whether the three packages being exported to OSGi (
osgi-extra.conflines 363, 373, 453) changes the recommendation. - Record the findings and the decision on this issue. Any code change is follow-up work, not part of this spike.
Context
Found during a code audit of the database access layer.
What is known so far, and where the first pass was wrong:
- A first search reported the three methods as having no callers at all. That search filtered by file extension and missed
.jsp_nocomp.SearchAndReplace.jsp_nocompdoes call two of them:getLinkByConditionat line 424 andgetContainerByConditionat line 437. OnlydeleteMultiTreesForInodeshas no reference of any kind. web.xml:698maps the JSP servlet to*.jsp, and there is no mapping for*.jsp_nocomp, so that file is not expected to compile or run. This is the assumption the spike has to verify rather than inherit.- Search-and-replace exists today at
MaintenanceResource.java:587(/_searchAndReplace, callingMaintenanceUtil.DBSearchAndReplaceat:614) and throughAssetsSearchAndReplaceAjax, used byview_cms_maintenance.jsp. The parked JSP appears to predate that. - The replacement APIs for the three methods are
MenuLinkAPI.findLinks(...),ContainerAPI.findContainers(User, SearchParams)andMultiTreeAPI.deleteMultiTreesForIdentifiers(...). All three take aUser; the factory methods take none and apply no permission filtering.MultiTreeAPI.deleteMultiTreesForIdentifiersis also@WrapInTransactionand evicts the multi-tree cache, which the factory method does not. - Removing
MultiTreeFactory.deleteMultiTreesForInodeswould not remove the pattern from the codebase:MultiTreeAPIImpl.deleteMultiTreesForIdentifiersbuilds the sameIN (...)lists by concatenation and is live, called fromESContentFactoryImpl. That is separate work.
Links
- Add Semgrep rules to catch SQL injection anti-patterns in PR scans #35547 (Semgrep rules for query-assembly anti-patterns)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CVSS 4.0 : N/ACVSS 4.0: not a vulnerabilityCVSS 4.0: not a vulnerabilityTeam : SecurityIssues related to security and privacyIssues related to security and privacyType : Spikea time boxed issue to answer question(s)a time boxed issue to answer question(s)dotCMS : Technical DebtDealing with long standing tech debtDealing with long standing tech debt
Type
Projects
- StatusShow more project fieldsNew
Activity
mbiuki commentedon Oct 13, 2026
Security assessment
P3 - MediumWhy this priority: Hardening spike; reachability of the concatenated queries is unconfirmed, same baseline as core#35547.
Labels: added
CVSS 4.0 : N/A.Automated triage by the dotCMS Security team (Claude), 2026-10-13. To override, change the project's Priority field or the CVSS label. The next refresh keeps a manual change.