VYPR
Critical severityNVD Advisory· Published Jun 12, 2025· Updated Jan 12, 2026

XWiki allows SQL injection in query endpoint of REST API with Oracle

CVE-2024-56158

Description

XWiki is a generic wiki platform. It's possible to execute any SQL query in Oracle by using the function like DBMS_XMLGEN or DBMS_XMLQUERY. The XWiki query validator does not sanitize functions that would be used in a simple select and Hibernate allows using any native function in an HQL query. This vulnerability is fixed in 16.10.2, 16.4.7, and 15.10.16.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
org.xwiki.platform:xwiki-platform-oldcoreMaven
>= 1.0, < 15.10.1615.10.16
org.xwiki.platform:xwiki-platform-oldcoreMaven
>= 16.0.0-rc-1, < 16.4.716.4.7
org.xwiki.platform:xwiki-platform-oldcoreMaven
>= 16.5.0-rc-1, < 16.10.216.10.2

Affected products

1

Patches

1
ce855aae38ee

XWIKI-22734: Improve the standard query validator

https://github.com/xwiki/xwiki-platformThomas MortagneDec 20, 2024via ghsa
1 file changed · +9 8
  • xwiki-platform-core/xwiki-platform-oldcore/src/main/java/org/xwiki/query/hql/internal/StandardHQLCompleteStatementValidator.java+9 8 modified
    @@ -318,8 +318,8 @@ private Map<String, String> getTables(PlainSelect plainSelect)
     
         private void addFromItem(FromItem item, Map<String, String> tables)
         {
    -        if (item instanceof Table table) {
    -            String tableName = table.getName();
    +        if (item instanceof Table) {
    +            String tableName = ((Table) item).getName();
                 tables.put(item.getAlias() != null ? item.getAlias().getName() : tableName, tableName);
             }
         }
    @@ -341,8 +341,9 @@ private boolean isSelectItemAllowed(SelectItem selectItem, Map<String, String> t
     
         private boolean isAllowedAllTableColumns(ExpressionList parameters, Map<String, String> tables)
         {
    -        return parameters.getExpressions().get(0) instanceof AllTableColumns allTableColumns
    -            && isTableAllowed(getTableName(allTableColumns.getTable(), tables));
    +        Expression expression = parameters.getExpressions().get(0);
    +        return expression instanceof AllTableColumns
    +            && isTableAllowed(getTableName(((AllTableColumns) expression).getTable(), tables));
         }
     
         private boolean isAllowedAllColumns(ExpressionList parameters, Map<String, String> tables)
    @@ -361,12 +362,12 @@ private boolean isSelectExpressionAllowed(Expression expression, Map<String, Str
         {
             boolean safe = false;
     
    -        if (expression instanceof Column column) {
    -            if (isColumnAllowed(column, tables)) {
    +        if (expression instanceof Column) {
    +            if (isColumnAllowed(((Column) expression), tables)) {
                     safe = true;
                 }
    -        } else if (expression instanceof Function function) {
    -            safe = isSelectFunctionSafe(function, tables);
    +        } else if (expression instanceof Function) {
    +            safe = isSelectFunctionSafe(((Function) expression), tables);
             }
     
             return safe;
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.