VYPR
Moderate severityNVD Advisory· Published Sep 23, 2022· Updated Apr 23, 2025

Parse Server subject to Incorrect Resource Transfer Between Spheres

CVE-2022-39225

Description

Parse Server is an open source backend that can be deployed to any infrastructure that can run Node.js. In versions prior to 4.10.15, or 5.0.0 and above prior to 5.2.6, a user can write to the session object of another user if the session object ID is known. For example, an attacker can assign the session object to their own user by writing to the user field and then read any custom fields of that session object. Note that assigning a session to another user does not usually change the privileges of either of the two users, and a user cannot assign their own session to another user. This issue is patched in version 4.10.15 and above, and 5.2.6 and above. To mitigate this issue in unpatched versions add a beforeSave trigger to the _Session class and prevent writing if the requesting user is different from the user in the session object.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
parse-servernpm
< 4.10.154.10.15
parse-servernpm
>= 5.0.0, < 5.2.65.2.6

Affected products

1

Patches

1
37fed3062ccc

fix: session object properties can be updated by foreign user; this fixes a security vulnerability in which a foreign user can write to the session object of another user if the session object ID is known; the fix prevents writing to foreign session objects ([GHSA-6w4q-23cf-j9jp](https://github.com/parse-community/parse-server/security/advisories/GHSA-6w4q-23cf-j9jp)) [skip release] (#8180)

2 files changed · +42 0
  • spec/ParseSession.spec.js+28 0 modified
    @@ -3,6 +3,7 @@
     //
     
     'use strict';
    +const request = require('../lib/request');
     
     function setupTestUsers() {
       const user1 = new Parse.User();
    @@ -135,4 +136,31 @@ describe('Parse.Session', () => {
             fail(err);
           });
       });
    +
    +  it('cannot edit session with known ID', async () => {
    +    await setupTestUsers();
    +    const [first, second] = await new Parse.Query(Parse.Session).find({ useMasterKey: true });
    +    const headers = {
    +      'X-Parse-Application-Id': 'test',
    +      'X-Parse-Rest-API-Key': 'rest',
    +      'X-Parse-Session-Token': second.get('sessionToken'),
    +      'Content-Type': 'application/json',
    +    };
    +    const firstUser = first.get('user').id;
    +    const secondUser = second.get('user').id;
    +    const e = await request({
    +      method: 'PUT',
    +      headers,
    +      url: `http://localhost:8378/1/sessions/${first.id}`,
    +      body: JSON.stringify({
    +        foo: 'bar',
    +        user: { __type: 'Pointer', className: '_User', objectId: secondUser },
    +      }),
    +    }).catch(e => e.data);
    +    expect(e.code).toBe(Parse.Error.OBJECT_NOT_FOUND);
    +    expect(e.error).toBe('Object not found.');
    +    await Parse.Object.fetchAll([first, second], { useMasterKey: true });
    +    expect(first.get('user').id).toBe(firstUser);
    +    expect(second.get('user').id).toBe(secondUser);
    +  });
     });
    
  • src/RestWrite.js+14 0 modified
    @@ -1019,6 +1019,20 @@ RestWrite.prototype.handleSession = function () {
         } else if (this.data.sessionToken) {
           throw new Parse.Error(Parse.Error.INVALID_KEY_NAME);
         }
    +    if (!this.auth.isMaster) {
    +      this.query = {
    +        $and: [
    +          this.query,
    +          {
    +            user: {
    +              __type: 'Pointer',
    +              className: '_User',
    +              objectId: this.auth.user.id,
    +            },
    +          },
    +        ],
    +      };
    +    }
       }
     
       if (!this.query && !this.auth.isMaster) {
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.