Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace "AllowSymLinkAliasChecker" with "SymlinkAllowedResourceAliasChecker" #114

Open
andrus opened this issue Jan 7, 2023 · 1 comment

Comments

@andrus
Copy link
Collaborator

andrus commented Jan 7, 2023

Now that jetty/jetty.project#8259 is fixed and incorporated to Bootique, let's test the issue and change AllowSymLinkAliasChecker back to the default SymlinkAllowedResourceAliasChecker. This would result in better Jetty security and will get rid of the warning in the logs:

WARN o.e.j.s.h.AllowSymLinkAliasChecker: Deprecated, use SymlinkAllowedResourceAliasChecker instead.
@andrus
Copy link
Collaborator Author

andrus commented Jan 8, 2023

Just committed the tests. They start failing once the following line is commented out in the ServerFactory:

contextHandler.setAliasChecks(List.of(new AllowSymLinkAliasChecker()));

Also discovered the fact that Bootique-installed DefaultServlet is immune to this problem because its factory canonicalizes resource base, implicitly resolving symlinks. It only happens when DefaultServlet is added manually with "resourceBase" containing a symlink.

To improve security, we should switch back to the default SymlinkAllowedResourceAliasChecker, and then deal with the rare fallout with one of these approaches:

  • Advise users to "canonicalize" their resource bases configured outside of Bootique static servlets API
  • Provide explicit API (extender, or likely YAML config) to register known roots with the alias checker

andrus added a commit that referenced this issue Jan 8, 2023
…Checker" #114

turning comments into a TODO referencing out task
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

No branches or pull requests

1 participant