Skip to content

Commit 065141f

Browse files
authored
build: release beta
2 parents 765cfd0 + 0575952 commit 065141f

File tree

7 files changed

+47
-10
lines changed

7 files changed

+47
-10
lines changed

Diff for: CONTRIBUTING.md

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
- [Merging](#merging)
2525
- [Breaking Change](#breaking-change-1)
2626
- [Reverting](#reverting)
27+
- [Releasing](#releasing)
28+
- [General Considerations](#general-considerations)
2729
- [Major Release / Long-Term-Support](#major-release--long-term-support)
2830
- [Versioning](#versioning)
2931
- [Code of Conduct](#code-of-conduct)
@@ -379,6 +381,12 @@ If the commit reverts a previous commit, use the prefix `revert:`, followed by t
379381
This reverts commit 1234567890abcdef.
380382
```
381383
384+
## Releasing
385+
386+
### General Considerations
387+
388+
- The `package-lock.json` file has to be deleted and recreated by npm from scratch in regular intervals using the `npm i` command. It is not enough to only update the file via automated security pull requests (e.g. dependabot, snyk), that can create inconsistencies between sub-devependencies of a dependency and increase the chances of vulnerabilities. The file should be recreated once every release cycle which is usually monthly.
389+
382390
### Major Release / Long-Term-Support
383391
384392
Long-Term-Support (LTS) is provided for the previous Parse Server major version. For example, Parse Server 4.x will receive security updates until Parse Server 5.x is superseded by Parse Server 6.x and becomes the new LTS version. While the current major version is published on branch `release`, a LTS version is published on branch `release-#.x.x`, for example `release-4.x.x` for the Parse Server 4.x LTS branch.

Diff for: changelogs/CHANGELOG_alpha.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [5.2.0-alpha.3](https://github.com/parse-community/parse-server/compare/5.2.0-alpha.2...5.2.0-alpha.3) (2022-03-24)
2+
3+
4+
### Bug Fixes
5+
6+
* security bump minimist from 1.2.5 to 1.2.6 ([#7884](https://github.com/parse-community/parse-server/issues/7884)) ([c5cf282](https://github.com/parse-community/parse-server/commit/c5cf282d11ffdc023764f8e7539a2bd6bc246fe1))
7+
8+
# [5.2.0-alpha.2](https://github.com/parse-community/parse-server/compare/5.2.0-alpha.1...5.2.0-alpha.2) (2022-03-24)
9+
10+
11+
### Bug Fixes
12+
13+
* sensitive keyword detection may produce false positives ([#7881](https://github.com/parse-community/parse-server/issues/7881)) ([0d6f9e9](https://github.com/parse-community/parse-server/commit/0d6f9e951d9e186e95e96d8869066ce7022bad02))
14+
115
# [5.2.0-alpha.1](https://github.com/parse-community/parse-server/compare/5.1.1...5.2.0-alpha.1) (2022-03-23)
216

317

Diff for: package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "5.2.0-beta.1",
3+
"version": "5.2.0-alpha.3",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {

Diff for: spec/vulnerabilities.spec.js

+14
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,18 @@ describe('Vulnerabilities', () => {
280280
expect(text.error).toBe('Prohibited keyword in request data: {"value":"aValue[123]*"}.');
281281
});
282282
});
283+
284+
describe('Ignore non-matches', () => {
285+
it('ignores write request that contains only fraction of denied keyword', async () => {
286+
await reconfigureServer({
287+
requestKeywordDenylist: [{ key: 'abc' }],
288+
});
289+
// Initially saving an object executes the keyword detection in RestWrite.js
290+
const obj = new TestObject({ a: { b: { c: 0 } } });
291+
await expectAsync(obj.save()).toBeResolved();
292+
// Modifying a nested key executes the keyword detection in DatabaseController.js
293+
obj.increment('a.b.c');
294+
await expectAsync(obj.save()).toBeResolved();
295+
});
296+
});
283297
});

Diff for: src/Controllers/DatabaseController.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import intersect from 'intersect';
1111
// @flow-disable-next
1212
import deepcopy from 'deepcopy';
1313
import logger from '../logger';
14+
import Utils from '../Utils';
1415
import * as SchemaController from './SchemaController';
1516
import { StorageAdapter } from '../Adapters/Storage/StorageAdapter';
1617
import MongoStorageAdapter from '../Adapters/Storage/Mongo/MongoStorageAdapter';
@@ -1763,8 +1764,8 @@ class DatabaseController {
17631764
if (this.options && this.options.requestKeywordDenylist) {
17641765
// Scan request data for denied keywords
17651766
for (const keyword of this.options.requestKeywordDenylist) {
1766-
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(a).test(b)) || a === b;
1767-
if (isMatch(firstKey, keyword.key)) {
1767+
const match = Utils.objectContainsKeyValue({ firstKey: undefined }, keyword.key, undefined);
1768+
if (match) {
17681769
throw new Parse.Error(
17691770
Parse.Error.INVALID_KEY_NAME,
17701771
`Prohibited keyword in request data: ${JSON.stringify(keyword)}.`

Diff for: src/Utils.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ class Utils {
341341
* @returns {Boolean} True if a match was found, false otherwise.
342342
*/
343343
static objectContainsKeyValue(obj, key, value) {
344-
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(a).test(b)) || a === b;
345-
const isKeyMatch = k => isMatch(key, k);
346-
const isValueMatch = v => isMatch(value, v);
344+
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(b).test(a)) || a === b;
345+
const isKeyMatch = k => isMatch(k, key);
346+
const isValueMatch = v => isMatch(v, value);
347347
for (const [k, v] of Object.entries(obj)) {
348348
if (key !== undefined && value === undefined && isKeyMatch(k)) {
349349
return true;

0 commit comments

Comments
 (0)