Repository navigation
fix: Update v6 compatibility layer with latest dependencies and dove - #3742
Merged
Merged
Conversation
Object.keys() returns __proto__ as an own enumerable key for JSON-parsed sources, causing the recursive merge to write onto Object.prototype. Skip __proto__/constructor/prototype keys. Reported-by: Andrew Ridings (@ridingsa)
Co-authored-by: Deepak kudi <deepakkudi23@adsl-172-10-9-116.dsl.sndg02.sbcglobal.net>
…#3696) * docs: document query schema vs adapter sanitization contract Clarify that validateQuery and the built-in adapter operator allowlist are alternative paths: a validated query schema is the full allowlist and skips sanitizeQuery. Point this out from validators, adapter common API, querying, schema helpers, and the security guide. * feat(schema): add replaceSanitization option to validateQuery Allow opting into defense in depth: with replaceSanitization: false, schema validation still runs but the query is not marked VALIDATED, so adapters continue to enforce their built-in operator and filter allowlist. Default remains true for backward compatibility. * test(mongodb): stabilize validated query sanitization test Reset shared service options (multi, disableObjectify, paginate) so earlier suite mutations cannot leave create/find in a bad state, and assert create actually returned a document before checking $regex. * refactor(schema): rename replaceSanitization to skipSanitize Shorter option name that matches the behavior: when true (default), adapter sanitizeQuery is skipped after validateQuery succeeds. * docs: warn that TypeBox Type.Object is permissive under Ajv by default Plain Type.Object without additionalProperties: false omits the keyword, so Ajv accepts unknown query keys. Call that out for validateQuery allowlists, querySyntax guidance, and the security guide. * fix: address PR review feedback for skipSanitize docs and tests Soften dual-path wording so skipSanitize: false is not contradictory, clarify validateQuery default options, fix the TypeBox docs link label, and add adapter-level coverage that skipSanitize: false still rejects non-allowlisted operators.
Document that OAuth providers belong under authentication.oauth and must not be listed in public authStrategies for browser redirect SSO. Rewrite flow #2 guidance so provider-token login requires a verifying getProfile, and cross-link guides and cookbooks.
…3699) * fix(authentication-oauth): allow any port on loopback OAuth origins Exact origin matching from the 5.0.40 security fix rejected common local dev setups where the frontend runs on a different port than the configured origin (e.g. http://localhost vs http://localhost:5173). For localhost, 127.0.0.1, and ::1 only, match on scheme + host and ignore port, then redirect using the referer origin so the token returns to the correct local port. Non-loopback hosts still require an exact origin match. Closes #3684 * fix(authentication-oauth): treat 0.0.0.0 as loopback and improve origin errors Include 0.0.0.0 in the loopback port-flex allowlist used for local OAuth redirects. When a referer is rejected, report the normalized origin, configured allowlist, and a short hint about ports and loopback matching.
* fix(adapter-commons): validate query operators nested in arrays
validateQueryProperty skipped array values because isPlainObject
excludes arrays. That let unknown $ operators through when wrapped
in an extra array level, e.g. $or: [[{ $where: '1==1' }]]. Recurse
into arrays so the operator allow-list applies at every level.
* fix: validate filter values and tighten ObjectIdSchema
filterQuery left $select, $or, $and, and $sort object values
unvalidated, so unknown $ operators could ride through those
filters. ObjectIdSchema accepted any object, which let operator
documents pass querySyntax on generated MongoDB services.
Validate those filter values with validateQueryProperty. The
objectid keyword now accepts ObjectId instances and rejects
other objects, and ObjectIdSchema uses that for its object branch.
* fix(schema): allow $exists on queryProperty after ObjectIdSchema tighten
Tightening ObjectIdSchema dropped { _id: { $exists: true } }, which
only passed because the old any-object branch treated the operator
document as an id. Add $exists as a boolean operator on queryProperty
so it is allowed on every querySyntax field, including ObjectIds.
* fix(schema): allow null in $ne, $in, and $nin query operators
{ userId: { $ne: null } } is the usual Mongo and SQL "field is set"
query. After tightening ObjectIdSchema it only passed when the field
type already included null. Accept null on $ne/$in/$nin in
queryProperty so ObjectId, number, and string fields all allow it.
* docs: show querySyntax extensions for adapter-specific queries
The default syntax already covers $ne/$in/$nin null and $exists.
Document how to add $like/$regex/array operators, how to allow
{ userId: null } on ObjectId query fields, and how $meta/$slice
map to service operators rather than querySyntax.
* fix: allow null equality, projection ops, and Mongo $regex
{ userId: null } is a real IS NULL query; accept null on the
queryProperty equality branch the same way as $ne/$in/$nin.
Allow $meta/$slice/$elemMatch inside object $select and $sort
(not as field operators). Add more with projectionOperators.
@feathersjs/mongodb defaults operators to include $regex and
$options. Generated Mongo query schemas do the same on the
primary string field.
* revert: drop new query syntax obligations
Keep the allow-list tightenings. Remove $exists, implicit null
equality, default Mongo $regex, and projectionOperators so those
stay app-level extensions via querySyntax or operators, not new
supported syntax.
* test: cover typical querySyntax and operators extensions
Assert $regex/$options, $like, $exists, $meta, and nullable
ObjectId fields still work when the app opts in, and that
unlisted operators such as $where stay rejected.
* fix: reject spoofed ObjectId JSON and correct querySyntax example
isObjectId now requires instanceof ObjectId, or _bsontype plus a
non-Object constructor and toHexString, so `{ _bsontype: 'ObjectId' }`
does not pass ObjectIdSchema. Attach $regex/$options to text in the
TypeBox Pick example.
* test(mongodb): isolate validated $regex find from service create
CI failed because people.create() returned no _id after earlier
aggregation tests mutated the shared service. Insert the fixture
through the collection so the test only covers validateQuery + $regex.
* fix(knex): omit query from PostgreSQL error messages The PostgreSQL branch of the error handler stripped the SQL from the raw driver error message but the constructed errors used the raw message, so the SQL still went through. Improved the SQL parsing and actually used it for the error construction. Fixes #3711 * fix(knex): omit queries from all database error messages Closes #3711 * fix(knex): omit queries from patch, count and compile errors * fix(knex): only strip queries from database driver errors --------- Co-authored-by: ssande-fwd <ssande@forwardedu.com>
…#3735) Co-authored-by: Mathew Thompson <mathewthompson@Mathews-MacBook-Air.local>
Keep the Eagle v6 package versions and updated dependencies. Port the HEAD request mapping and prototype pollution fixes into the v6 compatibility layer and adapt the merged imports to the ESM layout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.