Skip to content

fix: validate rex_list sort column against sortable whitelist#6580

Merged
gharlan merged 1 commit into
5.xfrom
fix/rex-list-sort-column-whitelist
Jun 29, 2026
Merged

fix: validate rex_list sort column against sortable whitelist#6580
gharlan merged 1 commit into
5.xfrom
fix/rex-list-sort-column-whitelist

Conversation

@gharlan

@gharlan gharlan commented Jun 29, 2026

Copy link
Copy Markdown
Member

rex_list::getSortColumn() returned the raw sort request parameter without checking it against the columns registered via setColumnSortable(). The value was backtick-escaped (no classical SQL injection), but an authenticated backend user could still ORDER BY any column of the query's FROM tables — including unselected sensitive columns like rex_user.password — and enumerate column names via error messages.

Now only columns flagged REX_LIST_OPT_SORT are accepted; anything else falls back to the default. The backend UI only emits sort links for sortable columns, so this is BC-safe for the normal flow.

@rex-bot rex-bot added the bug label Jun 29, 2026
@gharlan gharlan added this to the REDAXO 5.21.2 milestone Jun 29, 2026
getSortColumn() returned the raw `sort` request parameter without
checking it against the columns registered via setColumnSortable().
The value was backtick-escaped (no classical SQL injection), but an
authenticated backend user could still ORDER BY any column of the
query's FROM tables — including unselected sensitive columns such as
rex_user.password — and enumerate column names via error messages.

Restrict the accepted sort column to columns flagged REX_LIST_OPT_SORT;
anything else falls back to the default. The backend UI only ever emits
sort links for sortable columns, so this is BC-safe for the normal flow.

GHSA-4f5f-j737-pm58

Co-authored-by: de3erve-hunter <293707138+de3erve-hunter@users.noreply.github.com>
@gharlan
gharlan force-pushed the fix/rex-list-sort-column-whitelist branch from 55db18f to 2947430 Compare June 29, 2026 08:36
@gharlan
gharlan merged commit c44ba52 into 5.x Jun 29, 2026
18 checks passed
@gharlan
gharlan deleted the fix/rex-list-sort-column-whitelist branch June 29, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants