Skip to content

Commit

Permalink
OF-2893: Warn administrator when a wildcard pattern is loaded (but wi…
Browse files Browse the repository at this point in the history
…ldcards are disabled)
  • Loading branch information
Fishbowler committed Oct 20, 2024
1 parent cfda1ef commit 8401af5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions i18n/src/main/resources/openfire_i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2824,6 +2824,7 @@ plugin.admin.failed.minJavaVersion=The plugin requires Java specification versio
plugin.admin.failed.missingParent=The plugin requires another plugin, named {0}, that currently is not installed.
plugin.admin.failed.databaseScript=A plugin database install or update script failed. Review the logs for additional details.
plugin.admin.failed.unknown=An exception occurred while loading plugin. Review the logs for additional details.
plugin.admin.wildcards-exists=A plugin has loaded admin console authentication bypass patterns that includes a wildcard, but the System Property 'adminConsole.access.allow-wildcards-in-excludes' is disabled.

# System Admin Console access
system.admin.console.access.title=Admin Console Access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ public static void removeExclude(String exclude) {
excludes.remove(exclude);
}

/**
* Indicates to the caller whether any of the currently loaded exclusions contains a wildcard
*/
public static boolean excludesIncludeWildcards() {
return excludes.stream().anyMatch(e -> e.contains("*"));
}

/**
* Returns true if a URL passes an exclude rule.
*
Expand Down
6 changes: 6 additions & 0 deletions xmppserver/src/main/webapp/plugin-admin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
org.apache.commons.fileupload.disk.DiskFileItemFactory,
org.apache.commons.fileupload.servlet.ServletFileUpload"
%>
<%@ page import="org.jivesoftware.admin.AuthCheckFilter" %>
<%@ page import="org.jivesoftware.openfire.XMPPServer" %>
<%@ page import="org.jivesoftware.openfire.container.PluginManager" %>
<%@ page import="org.jivesoftware.openfire.update.UpdateManager" %>
Expand Down Expand Up @@ -369,6 +370,11 @@ tr.lowerhalf > td:last-child {
<fmt:message key="plugin.admin.monitortask_running" />
</admin:infobox>
</c:if>
<c:if test="${ AuthCheckFilter.excludesIncludeWildcards() && !AuthCheckFilter.ALLOW_WILDCARDS_IN_EXCLUDES.getValue() }">
<admin:infobox type="warning">
<fmt:message key="plugin.admin.wildcards-exists" />
</admin:infobox>
</c:if>
<p>
<fmt:message key="plugin.admin.info"/>
</p>
Expand Down

0 comments on commit 8401af5

Please sign in to comment.