You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix signup path by promoting the newly-issued session token into the in-flight auth context and clearing the password dirty state immediately after applying a signup response. This prevents an after_create callback (e.g. from parse_reference) from issuing an authenticated update that falls back to master-key authority, and avoids a Parse Server bcrypt crash caused by serializing password as a Delete op. Tests were added to cover the promotion, bounded scope of the promotion, and that password is not included in follow-up updates. Changelog and version bumped to 4.1.1.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,15 @@
1
1
## Parse-Stack Changelog
2
2
3
+
### 4.1.1
4
+
5
+
#### Bug Fixes
6
+
7
+
-**FIXED**: `Parse::User#save` on a new user whose subclass declares `parse_reference` (with the default `precompute: false`) no longer crashes Parse Server with `Value is non of these types TypedArray<u8>, String` from `@node-rs/bcrypt`. `signup_create` now calls `changes_applied!` and `clear_partial_fetch_state!` immediately after applying the signup response, so by the time the `after_create _assign_<field>!` callback fires its follow-up `update!`, the dirty set no longer contains `password`. Previously, `attribute_updates` serialized the cleared password as `{ "__op": "Delete" }` and Parse Server's `_User` write path fed that hash to the rust bcrypt binding, which rejects anything that isn't a string or u8 buffer. The behavior mirrors the dirty-state clearing already performed by `signup!` and `login!` in 4.0.2, but timed inside the `:create` callback block so it lands before the after_create chain runs rather than after the surrounding `save` completes. (`lib/parse/model/classes/user.rb`)
8
+
9
+
#### Hardening
10
+
11
+
- **FIXED**: `Parse::User#signup_create` now promotes the newly-issued session token into `@_session_token` after applying the signup response, so any in-flight `after_create` callback that re-enters the SDK (notably `_assign_<field>!` installed by `parse_reference`) authenticates the follow-up `update!` as the just-signed-up user. Previously the auth context was `nil`, and `Parse::Client#request` (`lib/parse/client.rb:682-687`) only attaches the session-token header when the token is `present?` while never setting `DISABLE_MASTER_KEY` on the nil branch — so the after_create PUT silently fell back to master-key authority under the default client configuration. That bypassed CLP and `request.user` checks in `beforeSave` cloud code on writes to the new user's own row. The promotion is scoped to the in-flight save (the outer `Parse::Object#save` zeroes `@_session_token` at `lib/parse/model/core/actions.rb:830` after the callback chain returns) and does not widen the existing trust boundary around `SIGNUP_RESPONSE_APPLY_KEYS`. The bcrypt crash above made this auth path unreachable before 4.1.1, so there is no field-deployed exposure to remediate — this is correctness hardening surfaced during review of the bcrypt fix. (`lib/parse/model/classes/user.rb`)
0 commit comments