NET-11737 - sec vulnerability - remediate ability to use bexpr to filter results without ACL read on endpoint #21950
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Allows bexpr filters constructed from user input only on data that the user is authorized to read.
Effect on the meaning
X-Consul-Results-Filtered-By-ACLs
when used withfilter
With this change, when using the
filter
query parameter, the meaning ofX-Consul-Results-Filtered-By-ACLs
changes in the following way:there are other resources that you do not have access to that match your filter
there are other resources that you do not have access to that may or may not match your filter
In essence, the
X-Consul-Results-Filtered-By-ACLs
header response as though there was nofilter
.Let's assume this set up:
web-
filter
query param is set to:api-2
In the current implementation on the
main
branch, you would have this logic flow:filter
param gets 0 of the 10 intentionsX-Consul-Results-Filtered-By-ACLs
set to falseX-Consul-Results-Filtered-By-ACLs
is set to falseIn changing the logic, the flow would now be:
X-Consul-Results-Filtered-By-ACLs
to truefilter
param then matches zero resultsX-Consul-Results-Filtered-By-ACLs
is set to trueX-Consul-Results-Filtered-By-ACLs
indicates there are more resources that the token has access to, but there is no guarantee that thefilter
query parameter would filter them out.We will need to document this in our docs as well as the change in behavior in our changelog.
Testing & Reproduction steps
List of Effected Code
Based on GitHub
These references show up in the search for go-expr used in the vulnerability report, but do not create and run filters, they only use an evaluator to validate the syntax is valid and do not expose object data:
QueryMeta
the way that IndexedCheckServiceNodes does.PR Checklist