Skip to content

$eq permissions granted when not listed #1111

@Helveg

Description

@Helveg

It seems from the code that $eq permissions are always granted on a column, which probably snuck in as a way to allow things like the $not:5 token to work:

if (
token.operator &&
token.operator !== FilterOperator.EQ &&
!allowedOperators.includes(token.operator)
) {
continue
}

In order to hit that line you have to make it past:

        if (!(column in filterableColumns)) {
            continue
        }

which means this doesn't affect columns that aren't explicitly listed. But if my hunch is correct, then:

paginationConfig = {
  filterableColumns: {
    colA: [FilterOperator.LT],
    colB: []
  }
}

would give the $eq permission to both colA and more importantly for colB, which might leak unwanted filtering capacities to consumers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions