Skip to content

fix(setup): refuse server-side pages when installing a theme from the command line - #3473

Merged
marevol merged 1 commit into
mainfrom
fix/setup-theme-reject-server-side
Sep 23, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/setup-theme-reject-server-side

Conversation

@marevol

@marevol marevol commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

#3466 made the admin screen's theme installer refuse an archive carrying a .jsp, .jspx or .jspf entry, but fess-setup install theme goes through org.codelibs.fess.setup.ThemeInstaller, which never applied that check: an archive with assets/p.jsp was extracted into app/themes/<name>/ and the command exited 0.

Fess already answers 404 for those extensions under /themes/ (StaticThemeFilter), so this is consistency and defence in depth rather than a fix for an exploitable path.

Changes

  • ThemeInstaller.install checks the files extracted into the staging directory, after the manifest check and before an installed theme is moved aside. On a match it fails with The archive has a server-side page, which a static theme may not carry: <path>; the staging directory is removed as for every other failure, the installed theme is left untouched, and fess-setup exits 1.
  • The extension list and the case-insensitive comparison mirror StaticThemeInstaller.isServerSidePage. The check is reimplemented in the setup package rather than shared, because fess-setup.jar runs with only the JDK on its class path.

Testing

  • New tests in ThemeInstallerTest: archives with assets/p.jsp, x.jspx, inc/x.jspf and assets/P.JSP are refused with the entry named in the message and nothing left behind; a refused archive leaves an already-installed theme in place and creates no attic entry; isServerSidePage matching.
  • mvn test -Dtest='org.codelibs.fess.setup.*Test': 205 tests, 0 failures. With the new check disabled the two install tests fail.
  • Built fess-setup.jar and ran install theme x:1.0.0 --repository <local repo> against an archive with assets/p.jsp: before, rc=0 and the file was installed; after, rc=1 with the error above and no theme directory created.
  • The constant pools of the classes in the built fess-setup.jar still reference only java, javax, org.w3c, org.xml and org.codelibs.fess.setup classes.

… command line

The admin screen's theme installer refuses an archive carrying a .jsp,
.jspx or .jspf entry (#3466), but `fess-setup install theme` extracted
such an archive and installed it. Fess already answers 404 for those
extensions under /themes/, so this brings the command-line path in line
with the admin screen rather than closing an open hole.

- ThemeInstaller checks the extracted files in the staging directory,
  after the manifest check and before anything installed is moved aside,
  and fails with a message naming the offending file; the staging
  directory is removed and fess-setup exits non-zero.
- The extension list and the case-insensitive match mirror
  StaticThemeInstaller. The check is reimplemented in the setup package
  because fess-setup.jar runs with only the JDK on its class path.
@marevol marevol added this to the 15.9.0 milestone Sep 23, 2026
@marevol marevol self-assigned this Sep 23, 2026
@marevol
marevol merged commit 21f73a2 into main Sep 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant