Skip to content

refactor: CKEditor webjar swap + drop resource-server-content overlay#554

Merged
bjagg merged 2 commits into
uPortal-Project:masterfrom
bjagg:chore/resource-server-consolidation
May 13, 2026
Merged

refactor: CKEditor webjar swap + drop resource-server-content overlay#554
bjagg merged 2 commits into
uPortal-Project:masterfrom
bjagg:chore/resource-server-consolidation

Conversation

@bjagg
Copy link
Copy Markdown
Member

@bjagg bjagg commented May 7, 2026

Summary

Two commits, both part of the broader resource-server consolidation:

  1. d368c89 (prior) — swap CKEditor 4.3.2 (legacy /ResourceServingWebapp/-served, multiple historical XSS CVEs) for the org.webjars.npm:ckeditor4:4.22.1 webjar via /resource-server/webjars/ckeditor4/...; drop dead <rs:compressJs> taglib wrappers.
  2. 5016a82 (new) — drop the resource-server-content WAR overlay. The overlay was unpacking lodash 4.17.4 (4 CVEs), underscore, backbone, modernizr, normalize, and jquery-plugins into the WAR for nothing, plus an explicit maven-war-plugin extract of jquery/jqueryui/ckeditor — none of which any JSP/JS in the source references after d368c89.

Test plan

  • mvn clean install -DskipTests builds (verified locally on Java 11)
  • WAR has no rs/ directory (verified)
  • Smoke: visit /p/please-register/?pCm=config (or any SimpleContentPortlet config view), CKEditor mounts on the textarea — covered by uPortal-start's tests/ux/portlets/simple-content.spec.ts and tests/ux/smoke/visual-resource-server.spec.ts

@Naenyn
Copy link
Copy Markdown
Contributor

Naenyn commented May 8, 2026

This is dependent upon resource-server serving up the webjar of ckeditor4, which it does not yet. See uPortal-Project/resource-server#352 (comment)

@bjagg bjagg changed the title refactor(configureContent): swap CKEditor 4.3.2 -> webjar 4.22.1; drop <rs:compressJs> refactor: CKEditor webjar swap + drop resource-server-content overlay May 8, 2026
@bjagg
Copy link
Copy Markdown
Member Author

bjagg commented May 8, 2026

@Naenyn thanks for the catch. Pushed a commit to uPortal-Project/resource-server#352 adding org.webjars.npm:ckeditor4:4.22.1 to resource-server-webapp/pom.xml. Once that lands, the webjar will be served and this PR's swap should verify cleanly. Will ping again here once it's merged so you can re-test.

@bjagg
Copy link
Copy Markdown
Member Author

bjagg commented May 9, 2026

@Naenyn following up — uPortal-Project/resource-server#352 is merged, so the org.webjars.npm:ckeditor4:4.22.1 webjar is now served by resource-server. This PR's CKEditor swap should resolve cleanly now; ready for re-test whenever you have a moment.

bjagg added 2 commits May 11, 2026 12:51
…p <rs:compressJs>

Problem: configureContent.jsp loaded CKEditor from the legacy
/ResourceServingWebapp/rs/ckeditor/4.3.2 path. CKEditor 4.3.2 is from
2014 and has many subsequent XSS CVEs (CVE-2018-9861, CVE-2019-10742,
et al — patched through 4.22.x; CVE patches in 4.23+ require a paid
LTS license, which is why we land at 4.22.1). The page also wrapped
its initialization JS in <rs:compressJs>, a no-op tag the upstream
resource-server-utils marked @deprecated.

Goal: pull CKEditor 4 from the modern overlay's webjar
(org.webjars.npm:ckeditor4:4.22.1) and drop the deprecated wrapper.

Changes:
- src/main/webapp/WEB-INF/jsp/cms/configureContent.jsp: replace
  <rs:resourceURL value='/rs/ckeditor/4.3.2/ckeditor.js'/> with the
  static /resource-server/webjars/ckeditor4/ckeditor.js path; remove
  the <rs:compressJs>...</rs:compressJs> wrapper. The init body
  (CKEDITOR.replace + toolbarGroups config) is unchanged.

Notes: 4.22.1 emits a single console-error nag about the LTS upgrade —
known noise, filtered in upstream visual smoke. Long-term plan
documented in the workspace ledger: replace CKEditor + the bundled
TinyMCE in AnnouncementsPortlet with Quill (BSD-3, Apache-compatible,
HTML-native) once the editor migration is scheduled.
… dead libs)

Problem: SimpleContentPortlet declared a runtime <dependency> on the
resource-server-content WAR overlay plus a maven-war-plugin <overlay>
config that pulled in rs/jquery/1.10.2/, rs/jquery/1.11.0/,
rs/jqueryui/1.10.3/, and rs/ckeditor/4.3.2/. The overlay also unpacked
the entire rs/* tree of legacy libraries (lodash 4.17.4 with 4 known
CVEs, underscore, backbone, modernizr, normalize, plus jquery-plugins)
into the WAR even though no JSP/JS in the source referenced any of
them.  configureContent.jsp and ckeditor-callback.jsp were already
swapped over to /resource-server/webjars/* paths in the prior commit
on this branch (d368c89), so nothing in the WAR's own JSPs uses any
of the overlay-extracted directories.

Goal: drop the entire overlay (dep + maven-war-plugin extract). The
modern resource-server overlay deployed by uPortal-start serves
jquery, jqueryui, and ckeditor4 via webjars at /resource-server/...

Changes:
- pom.xml: drop the runtime <dependency> on resource-server-content;
  drop the maven-war-plugin <overlay> config that extracted the legacy
  rs/jquery, rs/jqueryui, and rs/ckeditor directories.
  resource-server-utils (type=jar, taglibs in use elsewhere) is
  unchanged.

Notes: paired with d368c89 which did the source-side path swap.
Verified `grep -rE 'rs/(jquery|jqueryui|ckeditor)|/SimpleContentPortlet/rs/' src/`
returns no matches. WAR shrinks meaningfully (every consumer pulls
jquery/jqueryui/ckeditor from /resource-server/webjars/ now).
@bjagg bjagg force-pushed the chore/resource-server-consolidation branch from 5016a82 to f8a34fc Compare May 11, 2026 20:02
@bjagg bjagg merged commit 959da5c into uPortal-Project:master May 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants