VYPR
Critical severityNVD Advisory· Published Mar 1, 2024· Updated Aug 22, 2024

Parse Server literalizeRegexPart SQL Injection

CVE-2024-27298

Description

parse-server is a Parse Server for Node.js / Express. This vulnerability allows SQL injection when Parse Server is configured to use the PostgreSQL database. The vulnerability has been fixed in 6.5.0 and 7.0.0-alpha.20.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
parse-servernpm
< 6.5.06.5.0
parse-servernpm
>= 7.0.0-alpha.1, < 7.0.0-alpha.207.0.0-alpha.20

Affected products

1

Patches

2
cbefe770a726

fix: Improve PostgreSQL injection detection; fixes security vulnerability [GHSA-6927-3vr9-fxf2](https://github.com/parse-community/parse-server/security/advisories/GHSA-6927-3vr9-fxf2) which affects Parse Server deployments using a Postgres database (#8961)

2 files changed · +26 1
  • spec/vulnerabilities.spec.js+25 0 modified
    @@ -433,3 +433,28 @@ describe('Vulnerabilities', () => {
         });
       });
     });
    +
    +describe('Postgres regex sanitizater', () => {
    +  it('sanitizes the regex correctly to prevent Injection', async () => {
    +    const user = new Parse.User();
    +    user.set('username', 'username');
    +    user.set('password', 'password');
    +    user.set('email', 'email@example.com');
    +    await user.signUp();
    +
    +    const response = await request({
    +      method: 'GET',
    +      url:
    +        "http://localhost:8378/1/classes/_User?where[username][$regex]=A'B'%3BSELECT+PG_SLEEP(3)%3B--",
    +      headers: {
    +        'Content-Type': 'application/json',
    +        'X-Parse-Application-Id': 'test',
    +        'X-Parse-REST-API-Key': 'rest',
    +      },
    +    });
    +
    +    expect(response.status).toBe(200);
    +    expect(response.data.results).toEqual(jasmine.any(Array));
    +    expect(response.data.results.length).toBe(0);
    +  });
    +});
    
  • src/Adapters/Storage/Postgres/PostgresStorageAdapter.js+1 1 modified
    @@ -2656,7 +2656,7 @@ function literalizeRegexPart(s: string) {
         .replace(/([^\\])(\\Q)/, '$1')
         .replace(/^\\E/, '')
         .replace(/^\\Q/, '')
    -    .replace(/([^'])'/, `$1''`)
    +    .replace(/([^'])'/g, `$1''`)
         .replace(/^'([^'])/, `''$1`);
     }
     
    
a6e654943536

fix: Improve PostgreSQL injection detection; fixes security vulnerability [GHSA-6927-3vr9-fxf2](https://github.com/parse-community/parse-server/security/advisories/GHSA-6927-3vr9-fxf2) which affects Parse Server deployments using a Postgres database (#8960)

2 files changed · +26 1
  • spec/vulnerabilities.spec.js+25 0 modified
    @@ -459,3 +459,28 @@ describe('Vulnerabilities', () => {
         });
       });
     });
    +
    +describe('Postgres regex sanitizater', () => {
    +  it('sanitizes the regex correctly to prevent Injection', async () => {
    +    const user = new Parse.User();
    +    user.set('username', 'username');
    +    user.set('password', 'password');
    +    user.set('email', 'email@example.com');
    +    await user.signUp();
    +
    +    const response = await request({
    +      method: 'GET',
    +      url:
    +        "http://localhost:8378/1/classes/_User?where[username][$regex]=A'B'%3BSELECT+PG_SLEEP(3)%3B--",
    +      headers: {
    +        'Content-Type': 'application/json',
    +        'X-Parse-Application-Id': 'test',
    +        'X-Parse-REST-API-Key': 'rest',
    +      },
    +    });
    +
    +    expect(response.status).toBe(200);
    +    expect(response.data.results).toEqual(jasmine.any(Array));
    +    expect(response.data.results.length).toBe(0);
    +  });
    +});
    
  • src/Adapters/Storage/Postgres/PostgresStorageAdapter.js+1 1 modified
    @@ -2656,7 +2656,7 @@ function literalizeRegexPart(s: string) {
         .replace(/([^\\])(\\Q)/, '$1')
         .replace(/^\\E/, '')
         .replace(/^\\Q/, '')
    -    .replace(/([^'])'/, `$1''`)
    +    .replace(/([^'])'/g, `$1''`)
         .replace(/^'([^'])/, `''$1`);
     }
     
    

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

7

News mentions

0

No linked articles in our index yet.