Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test duplicate fields in Mango selector #998

Merged

Conversation

willholley
Copy link
Member

Overview

Adds a test to verify the behaviour of duplicate fields in a Mango selector.

The fix for CVE-2017-12635 (#936) resulted in CouchDB's JSON parser only recognising the last instance of duplicated fields in a JSON object. This represents a breaking change to Mango (_find)
because, previuously, all instances would have been considered when evaluating a selector.

This test verifies that Mango now only considers the last instance of a field, silently ignoring
those that appear before it.

TBD whether we can or should show an error when this occurs, since this leads to predicates
silently being ignored.

Testing recommendations

Run the Mango test suite.

Related Issues or Pull Requests

#936

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

@willholley willholley force-pushed the mango_test_duplicated_selector_fields branch from 91a8b7e to 998f2af Compare November 22, 2017 17:54
Adds a test to verify the behaviour of duplicate
fields in a Mango selector.

The fix for CVE-2017-12635 resulted in CouchDB's
JSON parser only recognising the last instance
of duplicated fields in a JSON object. This
represents a breaking change to Mango (_find)
because, previuously, all instances would have
been considered when evaluating a selector.

This test verifies that Mango now only considers
the last instance of a field, silently ignoring
those that appear before it.

TBD whether we can or should show an error when
this occurs, since this leads to predicates
silently being ignored.
@willholley willholley force-pushed the mango_test_duplicated_selector_fields branch from 998f2af to a7ca8f0 Compare November 23, 2017 08:07
@willholley willholley merged commit a406cc0 into apache:master Nov 23, 2017
@willholley willholley deleted the mango_test_duplicated_selector_fields branch November 23, 2017 09:26
willholley added a commit to willholley/couchdb that referenced this pull request May 22, 2018
Adds a test to verify the behaviour of duplicate
fields in a Mango selector.

The fix for CVE-2017-12635 resulted in CouchDB's
JSON parser only recognising the last instance
of duplicated fields in a JSON object. This
represents a breaking change to Mango (_find)
because, previuously, all instances would have
been considered when evaluating a selector.

This test verifies that Mango now only considers
the last instance of a field, silently ignoring
those that appear before it.

TBD whether we can or should show an error when
this occurs, since this leads to predicates
silently being ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants