Compare commits
4 Commits
9.1.0-alph
...
9.1.0-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e308feaa7 | ||
|
|
a23b192466 | ||
|
|
98a42e5277 | ||
|
|
3074eb70f5 |
@@ -1,3 +1,17 @@
|
||||
# [9.1.0-alpha.4](https://github.com/parse-community/parse-server/compare/9.1.0-alpha.3...9.1.0-alpha.4) (2025-12-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Log more debug info when failing to set duplicate value for field with unique values ([#9919](https://github.com/parse-community/parse-server/issues/9919)) ([a23b192](https://github.com/parse-community/parse-server/commit/a23b1924668920f3c92fec0566b57091d0e8aae8))
|
||||
|
||||
# [9.1.0-alpha.3](https://github.com/parse-community/parse-server/compare/9.1.0-alpha.2...9.1.0-alpha.3) (2025-12-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Cross-Site Scripting (XSS) via HTML pages for password reset and email verification [GHSA-jhgf-2h8h-ggxv](https://github.com/parse-community/parse-server/security/advisories/GHSA-jhgf-2h8h-ggxv) ([#9985](https://github.com/parse-community/parse-server/issues/9985)) ([3074eb7](https://github.com/parse-community/parse-server/commit/3074eb70f5b58bf72b528ae7b7804ed2d90455ce))
|
||||
|
||||
# [9.1.0-alpha.2](https://github.com/parse-community/parse-server/compare/9.1.0-alpha.1...9.1.0-alpha.2) (2025-12-14)
|
||||
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "parse-server",
|
||||
"version": "9.1.0-alpha.2",
|
||||
"version": "9.1.0-alpha.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "parse-server",
|
||||
"version": "9.1.0-alpha.2",
|
||||
"version": "9.1.0-alpha.4",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "parse-server",
|
||||
"version": "9.1.0-alpha.2",
|
||||
"version": "9.1.0-alpha.4",
|
||||
"description": "An express module providing a Parse-compatible API server",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<body>
|
||||
<h1>{{appName}}</h1>
|
||||
<h1>Expired verification link!</h1>
|
||||
<form method="POST" action="{{{publicServerUrl}}}/apps/{{{appId}}}/resend_verification_email">
|
||||
<input name="token" type="hidden" value="{{{token}}}">
|
||||
<input name="locale" type="hidden" value="{{{locale}}}">
|
||||
<form method="POST" action="{{publicServerUrl}}/apps/{{appId}}/resend_verification_email">
|
||||
<input name="token" type="hidden" value="{{token}}">
|
||||
<input name="locale" type="hidden" value="{{locale}}">
|
||||
<button type="submit">Resend Link</button>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
<p>You can set a new Password for your account: {{username}}</p>
|
||||
<br />
|
||||
<p>{{error}}</p>
|
||||
<form id='form' action='{{{publicServerUrl}}}/apps/{{{appId}}}/request_password_reset' method='POST'>
|
||||
<form id='form' action='{{publicServerUrl}}/apps/{{appId}}/request_password_reset' method='POST'>
|
||||
<input name='utf-8' type='hidden' value='✓' />
|
||||
<input name="username" type="hidden" id="username" value="{{{username}}}" />
|
||||
<input name="token" type="hidden" id="token" value="{{{token}}}" />
|
||||
<input name="locale" type="hidden" id="locale" value="{{{locale}}}" />
|
||||
<input name="username" type="hidden" id="username" value="{{username}}" />
|
||||
<input name="token" type="hidden" id="token" value="{{token}}" />
|
||||
<input name="locale" type="hidden" id="locale" value="{{locale}}" />
|
||||
|
||||
<p>New Password</p>
|
||||
<input name="new_password" type="password" id="password" />
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<body>
|
||||
<h1>{{appName}}</h1>
|
||||
<h1>Expired verification link!</h1>
|
||||
<form method="POST" action="{{{publicServerUrl}}}/apps/{{{appId}}}/resend_verification_email">
|
||||
<input name="token" type="hidden" value="{{{token}}}">
|
||||
<input name="locale" type="hidden" value="{{{locale}}}">
|
||||
<form method="POST" action="{{publicServerUrl}}/apps/{{appId}}/resend_verification_email">
|
||||
<input name="token" type="hidden" value="{{token}}">
|
||||
<input name="locale" type="hidden" value="{{locale}}">
|
||||
<button type="submit">Resend Link</button>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
<p>You can set a new Password for your account: {{username}}</p>
|
||||
<br />
|
||||
<p>{{error}}</p>
|
||||
<form id='form' action='{{{publicServerUrl}}}/apps/{{{appId}}}/request_password_reset' method='POST'>
|
||||
<form id='form' action='{{publicServerUrl}}/apps/{{appId}}/request_password_reset' method='POST'>
|
||||
<input name='utf-8' type='hidden' value='✓' />
|
||||
<input name="username" type="hidden" id="username" value="{{{username}}}" />
|
||||
<input name="token" type="hidden" id="token" value="{{{token}}}" />
|
||||
<input name="locale" type="hidden" id="locale" value="{{{locale}}}" />
|
||||
<input name="username" type="hidden" id="username" value="{{username}}" />
|
||||
<input name="token" type="hidden" id="token" value="{{token}}" />
|
||||
<input name="locale" type="hidden" id="locale" value="{{locale}}" />
|
||||
|
||||
<p>New Password</p>
|
||||
<input name="new_password" type="password" id="password" />
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<body>
|
||||
<h1>{{appName}}</h1>
|
||||
<h1>Expired verification link!</h1>
|
||||
<form method="POST" action="{{{publicServerUrl}}}/apps/{{{appId}}}/resend_verification_email">
|
||||
<input name="token" type="hidden" value="{{{token}}}">
|
||||
<input name="locale" type="hidden" value="{{{locale}}}">
|
||||
<form method="POST" action="{{publicServerUrl}}/apps/{{appId}}/resend_verification_email">
|
||||
<input name="token" type="hidden" value="{{token}}">
|
||||
<input name="locale" type="hidden" value="{{locale}}">
|
||||
<button type="submit">Resend Link</button>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
<p>You can set a new Password for your account: {{username}}</p>
|
||||
<br />
|
||||
<p>{{error}}</p>
|
||||
<form id='form' action='{{{publicServerUrl}}}/apps/{{{appId}}}/request_password_reset' method='POST'>
|
||||
<form id='form' action='{{publicServerUrl}}/apps/{{appId}}/request_password_reset' method='POST'>
|
||||
<input name='utf-8' type='hidden' value='✓' />
|
||||
<input name="username" type="hidden" id="username" value="{{{username}}}" />
|
||||
<input name="token" type="hidden" id="token" value="{{{token}}}" />
|
||||
<input name="locale" type="hidden" id="locale" value="{{{locale}}}" />
|
||||
<input name="username" type="hidden" id="username" value="{{username}}" />
|
||||
<input name="token" type="hidden" id="token" value="{{token}}" />
|
||||
<input name="locale" type="hidden" id="locale" value="{{locale}}" />
|
||||
|
||||
<p>New Password</p>
|
||||
<input name="new_password" type="password" id="password" />
|
||||
|
||||
@@ -1180,4 +1180,72 @@ describe('Pages Router', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('XSS Protection', () => {
|
||||
beforeEach(async () => {
|
||||
await reconfigureServer({
|
||||
appId: 'test',
|
||||
appName: 'exampleAppname',
|
||||
publicServerURL: 'http://localhost:8378/1',
|
||||
pages: { enableRouter: true },
|
||||
});
|
||||
});
|
||||
|
||||
it('should escape XSS payloads in token parameter', async () => {
|
||||
const xssPayload = '"><script>alert("XSS")</script>';
|
||||
const response = await request({
|
||||
url: `http://localhost:8378/1/apps/choose_password?token=${encodeURIComponent(xssPayload)}&username=test&appId=test`,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.text).not.toContain('<script>alert("XSS")</script>');
|
||||
expect(response.text).toContain('"><script>');
|
||||
});
|
||||
|
||||
it('should escape XSS in username parameter', async () => {
|
||||
const xssUsername = '<img src=x onerror=alert(1)>';
|
||||
const response = await request({
|
||||
url: `http://localhost:8378/1/apps/choose_password?username=${encodeURIComponent(xssUsername)}&appId=test`,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.text).not.toContain('<img src=x onerror=alert(1)>');
|
||||
expect(response.text).toContain('<img');
|
||||
});
|
||||
|
||||
it('should escape XSS in locale parameter', async () => {
|
||||
const xssLocale = '"><svg/onload=alert(1)>';
|
||||
const response = await request({
|
||||
url: `http://localhost:8378/1/apps/choose_password?locale=${encodeURIComponent(xssLocale)}&appId=test`,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.text).not.toContain('<svg/onload=alert(1)>');
|
||||
expect(response.text).toContain('"><svg');
|
||||
});
|
||||
|
||||
it('should handle legitimate usernames with quotes correctly', async () => {
|
||||
const username = "O'Brien";
|
||||
const response = await request({
|
||||
url: `http://localhost:8378/1/apps/choose_password?username=${encodeURIComponent(username)}&appId=test`,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
// Should be properly escaped as HTML entity
|
||||
expect(response.text).toContain('O'Brien');
|
||||
// Should NOT contain unescaped quote that breaks HTML
|
||||
expect(response.text).not.toContain('value="O\'Brien"');
|
||||
});
|
||||
|
||||
it('should handle legitimate usernames with ampersands correctly', async () => {
|
||||
const username = 'Smith & Co';
|
||||
const response = await request({
|
||||
url: `http://localhost:8378/1/apps/choose_password?username=${encodeURIComponent(username)}&appId=test`,
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
// Should be properly escaped
|
||||
expect(response.text).toContain('Smith & Co');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3842,6 +3842,7 @@ describe('schemas', () => {
|
||||
});
|
||||
|
||||
it_id('cbd5d897-b938-43a4-8f5a-5d02dd2be9be')(it_exclude_dbs(['postgres']))('cannot update to duplicate value on unique index', done => {
|
||||
loggerErrorSpy.calls.reset();
|
||||
const index = {
|
||||
code: 1,
|
||||
};
|
||||
@@ -3868,6 +3869,12 @@ describe('schemas', () => {
|
||||
.then(done.fail)
|
||||
.catch(error => {
|
||||
expect(error.code).toEqual(Parse.Error.DUPLICATE_VALUE);
|
||||
// Client should only see generic message (no schema info exposed)
|
||||
expect(error.message).toEqual('A duplicate value for a field with unique values was provided');
|
||||
// Server logs should contain full MongoDB error message with detailed information
|
||||
expect(loggerErrorSpy).toHaveBeenCalledWith('Duplicate key error:', jasmine.stringContaining('E11000 duplicate key error'));
|
||||
expect(loggerErrorSpy).toHaveBeenCalledWith('Duplicate key error:', jasmine.stringContaining('test_UniqueIndexClass'));
|
||||
expect(loggerErrorSpy).toHaveBeenCalledWith('Duplicate key error:', jasmine.stringContaining('code_1'));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -519,7 +519,7 @@ export class MongoStorageAdapter implements StorageAdapter {
|
||||
.then(() => ({ ops: [mongoObject] }))
|
||||
.catch(error => {
|
||||
if (error.code === 11000) {
|
||||
// Duplicate value
|
||||
logger.error('Duplicate key error:', error.message);
|
||||
const err = new Parse.Error(
|
||||
Parse.Error.DUPLICATE_VALUE,
|
||||
'A duplicate value for a field with unique values was provided'
|
||||
@@ -605,6 +605,7 @@ export class MongoStorageAdapter implements StorageAdapter {
|
||||
.then(result => mongoObjectToParseObject(className, result, schema))
|
||||
.catch(error => {
|
||||
if (error.code === 11000) {
|
||||
logger.error('Duplicate key error:', error.message);
|
||||
throw new Parse.Error(
|
||||
Parse.Error.DUPLICATE_VALUE,
|
||||
'A duplicate value for a field with unique values was provided'
|
||||
|
||||
Reference in New Issue
Block a user