grafeo-ogm 1.13.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +221 -0
- package/README.md +70 -0
- package/dist/cjs/compilers/fulltext.compiler.d.ts.map +1 -1
- package/dist/cjs/compilers/fulltext.compiler.js +30 -14
- package/dist/cjs/compilers/fulltext.compiler.js.map +1 -1
- package/dist/cjs/compilers/mutation.compiler.d.ts +54 -1
- package/dist/cjs/compilers/mutation.compiler.d.ts.map +1 -1
- package/dist/cjs/compilers/mutation.compiler.js +134 -32
- package/dist/cjs/compilers/mutation.compiler.js.map +1 -1
- package/dist/cjs/compilers/where.compiler.d.ts.map +1 -1
- package/dist/cjs/compilers/where.compiler.js +7 -0
- package/dist/cjs/compilers/where.compiler.js.map +1 -1
- package/dist/cjs/generator/type-emitters/fulltext-emitter.js +24 -8
- package/dist/cjs/generator/type-emitters/fulltext-emitter.js.map +1 -1
- package/dist/cjs/generator/type-emitters/sort-options-emitter.d.ts +2 -1
- package/dist/cjs/generator/type-emitters/sort-options-emitter.d.ts.map +1 -1
- package/dist/cjs/generator/type-emitters/sort-options-emitter.js +12 -5
- package/dist/cjs/generator/type-emitters/sort-options-emitter.js.map +1 -1
- package/dist/cjs/generator/type-emitters/utility-types.d.ts.map +1 -1
- package/dist/cjs/generator/type-emitters/utility-types.js +20 -0
- package/dist/cjs/generator/type-emitters/utility-types.js.map +1 -1
- package/dist/cjs/interface-model.d.ts.map +1 -1
- package/dist/cjs/interface-model.js +9 -1
- package/dist/cjs/interface-model.js.map +1 -1
- package/dist/cjs/model.d.ts.map +1 -1
- package/dist/cjs/model.js +12 -3
- package/dist/cjs/model.js.map +1 -1
- package/dist/cjs/ogm.d.ts.map +1 -1
- package/dist/cjs/ogm.js +6 -1
- package/dist/cjs/ogm.js.map +1 -1
- package/dist/cjs/utils/cypher-sort-projection.d.ts +3 -0
- package/dist/cjs/utils/cypher-sort-projection.d.ts.map +1 -1
- package/dist/cjs/utils/cypher-sort-projection.js +13 -1
- package/dist/cjs/utils/cypher-sort-projection.js.map +1 -1
- package/dist/cjs/utils/validation.d.ts +79 -0
- package/dist/cjs/utils/validation.d.ts.map +1 -1
- package/dist/cjs/utils/validation.js +554 -0
- package/dist/cjs/utils/validation.js.map +1 -1
- package/dist/esm/compilers/fulltext.compiler.d.ts.map +1 -1
- package/dist/esm/compilers/fulltext.compiler.js +31 -15
- package/dist/esm/compilers/fulltext.compiler.js.map +1 -1
- package/dist/esm/compilers/mutation.compiler.d.ts +54 -1
- package/dist/esm/compilers/mutation.compiler.d.ts.map +1 -1
- package/dist/esm/compilers/mutation.compiler.js +134 -32
- package/dist/esm/compilers/mutation.compiler.js.map +1 -1
- package/dist/esm/compilers/where.compiler.d.ts.map +1 -1
- package/dist/esm/compilers/where.compiler.js +8 -1
- package/dist/esm/compilers/where.compiler.js.map +1 -1
- package/dist/esm/generator/type-emitters/fulltext-emitter.js +24 -8
- package/dist/esm/generator/type-emitters/fulltext-emitter.js.map +1 -1
- package/dist/esm/generator/type-emitters/sort-options-emitter.d.ts +2 -1
- package/dist/esm/generator/type-emitters/sort-options-emitter.d.ts.map +1 -1
- package/dist/esm/generator/type-emitters/sort-options-emitter.js +12 -5
- package/dist/esm/generator/type-emitters/sort-options-emitter.js.map +1 -1
- package/dist/esm/generator/type-emitters/utility-types.d.ts.map +1 -1
- package/dist/esm/generator/type-emitters/utility-types.js +20 -0
- package/dist/esm/generator/type-emitters/utility-types.js.map +1 -1
- package/dist/esm/interface-model.d.ts.map +1 -1
- package/dist/esm/interface-model.js +9 -1
- package/dist/esm/interface-model.js.map +1 -1
- package/dist/esm/model.d.ts.map +1 -1
- package/dist/esm/model.js +12 -3
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/ogm.d.ts.map +1 -1
- package/dist/esm/ogm.js +6 -1
- package/dist/esm/ogm.js.map +1 -1
- package/dist/esm/utils/cypher-sort-projection.d.ts +3 -0
- package/dist/esm/utils/cypher-sort-projection.d.ts.map +1 -1
- package/dist/esm/utils/cypher-sort-projection.js +14 -2
- package/dist/esm/utils/cypher-sort-projection.js.map +1 -1
- package/dist/esm/utils/validation.d.ts +79 -0
- package/dist/esm/utils/validation.d.ts.map +1 -1
- package/dist/esm/utils/validation.js +549 -0
- package/dist/esm/utils/validation.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,8 +6,13 @@ exports.assertSafeIdentifier = assertSafeIdentifier;
|
|
|
6
6
|
exports.escapeIdentifier = escapeIdentifier;
|
|
7
7
|
exports.assertSafeLabel = assertSafeLabel;
|
|
8
8
|
exports.assertSortDirection = assertSortDirection;
|
|
9
|
+
exports.assertSingleSortKey = assertSingleSortKey;
|
|
10
|
+
exports.assertSingleFulltextKey = assertSingleFulltextKey;
|
|
11
|
+
exports.assertSingleFulltextOperator = assertSingleFulltextOperator;
|
|
9
12
|
exports.isPlainObject = isPlainObject;
|
|
13
|
+
exports.assertPlainObject = assertPlainObject;
|
|
10
14
|
exports.mergeParams = mergeParams;
|
|
15
|
+
exports.assertSafeRegexPattern = assertSafeRegexPattern;
|
|
11
16
|
const errors_1 = require("../errors");
|
|
12
17
|
/** Dangerous property names that could indicate prototype pollution */
|
|
13
18
|
const BLOCKED_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
@@ -80,6 +85,108 @@ function assertSortDirection(direction) {
|
|
|
80
85
|
throw new errors_1.OGMError(`Invalid sort direction "${direction}". Must be "ASC" or "DESC".`);
|
|
81
86
|
return direction;
|
|
82
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Shared opening clause for "this object may carry only one key" violations.
|
|
90
|
+
*
|
|
91
|
+
* Keys are interpolated verbatim, so every caller must have run
|
|
92
|
+
* `assertSafeIdentifier` over ALL of them first — never just the surviving one.
|
|
93
|
+
*/
|
|
94
|
+
function singleKeyPrefix(entries, subject) {
|
|
95
|
+
const keys = entries.map(([key]) => key);
|
|
96
|
+
return `${subject} has ${entries.length} keys (${keys.join(', ')}); `;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Assert that a single `sort` array entry carries exactly one ordering key.
|
|
100
|
+
*
|
|
101
|
+
* v2.0.0 — pre-2.0.0 `compileSortClause` read only `Object.entries(entry)[0]`
|
|
102
|
+
* and silently discarded the rest, so `[{ a: 'ASC', b: 'DESC' }]` compiled to
|
|
103
|
+
* `ORDER BY n.a ASC` with no error and no log: a successful query answering a
|
|
104
|
+
* different question. Which key survived depended purely on source insertion
|
|
105
|
+
* order.
|
|
106
|
+
*
|
|
107
|
+
* Ordering precedence must be carried by ARRAY POSITION, never by object key
|
|
108
|
+
* order. Honoring every key would only move the bug: graphql-js
|
|
109
|
+
* `coerceInputValue` rebuilds input objects by iterating the schema's field
|
|
110
|
+
* definitions, so the key order a client wrote is already gone by the time the
|
|
111
|
+
* object reaches the OGM.
|
|
112
|
+
*
|
|
113
|
+
* Callers must validate each key with `assertSafeIdentifier` BEFORE calling
|
|
114
|
+
* this, so the keys interpolated into the message are known-safe.
|
|
115
|
+
*/
|
|
116
|
+
function assertSingleSortKey(entries) {
|
|
117
|
+
if (entries.length <= 1)
|
|
118
|
+
return;
|
|
119
|
+
// Only echo directions we recognise — an unvalidated value must never reach
|
|
120
|
+
// an error string that may be logged.
|
|
121
|
+
const suggestion = entries
|
|
122
|
+
.map(([key, value]) => `{ ${key}: ${value === 'ASC' || value === 'DESC' ? `'${value}'` : '...'} }`)
|
|
123
|
+
.join(', ');
|
|
124
|
+
throw new errors_1.OGMError(singleKeyPrefix(entries, 'Sort entry') +
|
|
125
|
+
`each sort entry must carry exactly one ordering key, because ORDER BY ` +
|
|
126
|
+
`precedence comes from array position and not object key order. ` +
|
|
127
|
+
`Use one entry per key: [${suggestion}].`);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Assert that a fulltext input object references exactly one index.
|
|
131
|
+
*
|
|
132
|
+
* v2.0.0 — the same silent-truncation defect fixed for `sort` (see
|
|
133
|
+
* `assertSingleSortKey`) also lived in `FulltextCompiler`, at three sites that
|
|
134
|
+
* each guarded the empty case and then read `Object.keys(input)[0]`. A leaf
|
|
135
|
+
* naming two indexes searched only the first and dropped the second with no
|
|
136
|
+
* error, so the query returned a strictly WIDER result set than asked for — a
|
|
137
|
+
* filter that silently stops filtering.
|
|
138
|
+
*
|
|
139
|
+
* Multiple indexes are expressed with the existing `AND` / `OR` combinators,
|
|
140
|
+
* which compile to correlated subqueries and `UNION` respectively.
|
|
141
|
+
*
|
|
142
|
+
* Phrase values are never echoed: they are user data and may carry control
|
|
143
|
+
* characters or sensitive content. Callers must validate each key with
|
|
144
|
+
* `assertSafeIdentifier` BEFORE calling this.
|
|
145
|
+
*/
|
|
146
|
+
function assertSingleFulltextKey(entries, subject) {
|
|
147
|
+
if (entries.length <= 1)
|
|
148
|
+
return;
|
|
149
|
+
const suggestion = entries.map(([key]) => `{ ${key}: … }`).join(', ');
|
|
150
|
+
throw new errors_1.OGMError(singleKeyPrefix(entries, subject) +
|
|
151
|
+
`a fulltext entry must reference exactly one index. Combine indexes with ` +
|
|
152
|
+
`the AND / OR operators instead: { AND: [${suggestion}] }.`);
|
|
153
|
+
}
|
|
154
|
+
/** The logical operators a fulltext input may carry, each exclusive. */
|
|
155
|
+
const FULLTEXT_OPERATORS = ['OR', 'AND', 'NOT'];
|
|
156
|
+
/**
|
|
157
|
+
* Assert that a fulltext input carrying `OR` / `AND` / `NOT` carries nothing
|
|
158
|
+
* else alongside it.
|
|
159
|
+
*
|
|
160
|
+
* v2.0.0 — the dispatch in `FulltextCompiler.compileNode` tests the operators
|
|
161
|
+
* in order (`OR`, then `AND`, then `NOT`) and returns on the first hit, so any
|
|
162
|
+
* remaining top-level key was silently discarded:
|
|
163
|
+
*
|
|
164
|
+
* - `{ OR: [...], AND: [...] }` compiled the OR branch only.
|
|
165
|
+
* - `{ OR: [...], SomeIndex: {...} }` compiled the OR branch only.
|
|
166
|
+
* - `{ NOT: {...}, AND: [...] }` compiled the AND branch only — an exclusion
|
|
167
|
+
* filter vanished entirely, which inverts the caller's intent rather than
|
|
168
|
+
* merely widening the result set.
|
|
169
|
+
*
|
|
170
|
+
* Operators nest instead of stacking: `{ AND: [{ OR: [...] }, { ... }] }`.
|
|
171
|
+
*
|
|
172
|
+
* Only the recognised operator names — fixed literals — are interpolated into
|
|
173
|
+
* the message. Sibling keys are counted, never echoed, because they have not
|
|
174
|
+
* been identifier-validated at this point in the pipeline.
|
|
175
|
+
*/
|
|
176
|
+
function assertSingleFulltextOperator(keys) {
|
|
177
|
+
const operators = FULLTEXT_OPERATORS.filter((op) => keys.includes(op));
|
|
178
|
+
// No operator → a plain leaf, whose arity `assertSingleFulltextKey` owns.
|
|
179
|
+
if (operators.length === 0)
|
|
180
|
+
return;
|
|
181
|
+
if (keys.length === 1)
|
|
182
|
+
return;
|
|
183
|
+
const others = keys.length - operators.length;
|
|
184
|
+
const alongside = others > 0 ? ` and ${others} other top-level key(s)` : '';
|
|
185
|
+
throw new errors_1.OGMError(`Fulltext input carries ${operators.join(' + ')}${alongside}; ` +
|
|
186
|
+
`AND / OR / NOT must each be the only key in their object, because the ` +
|
|
187
|
+
`compiler reads the first one and ignores the rest. ` +
|
|
188
|
+
`Nest them instead: { AND: [{ OR: [...] }, { ... }] }.`);
|
|
189
|
+
}
|
|
83
190
|
/**
|
|
84
191
|
* Type guard that narrows an unknown value to a plain object.
|
|
85
192
|
* Returns false for null, arrays, and non-object primitives.
|
|
@@ -87,6 +194,33 @@ function assertSortDirection(direction) {
|
|
|
87
194
|
function isPlainObject(value) {
|
|
88
195
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
89
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Assert that a value the compilers are about to enumerate — with
|
|
199
|
+
* `Object.entries`, `Object.keys`, or the `in` operator — is a plain object.
|
|
200
|
+
*
|
|
201
|
+
* v2.0.0 — without this, `sort: [null]` surfaced as a bare
|
|
202
|
+
* `TypeError: Cannot convert undefined or null to object` thrown from deep
|
|
203
|
+
* inside the compiler, and fulltext inputs failed similarly on `'OR' in input`.
|
|
204
|
+
* Both escaped `catch (e) { if (e instanceof OGMError) … }`, even though every
|
|
205
|
+
* other malformed input on those paths is an `OGMError`.
|
|
206
|
+
*
|
|
207
|
+
* Only the value's KIND is reported, never the value itself — the caller may
|
|
208
|
+
* have handed us anything.
|
|
209
|
+
*/
|
|
210
|
+
function assertPlainObject(value, subject) {
|
|
211
|
+
if (isPlainObject(value))
|
|
212
|
+
return;
|
|
213
|
+
const kind = value === null
|
|
214
|
+
? 'null'
|
|
215
|
+
: value === undefined
|
|
216
|
+
? 'undefined'
|
|
217
|
+
: Array.isArray(value)
|
|
218
|
+
? 'an array'
|
|
219
|
+
: // Every remaining `typeof` result is consonant-initial, so a plain
|
|
220
|
+
// "a" article reads correctly here.
|
|
221
|
+
`a ${typeof value}`;
|
|
222
|
+
throw new errors_1.OGMError(`${subject} must be an object, got ${kind}.`);
|
|
223
|
+
}
|
|
90
224
|
/**
|
|
91
225
|
* Merge parameter records into the target. Skips merge if `source` is empty
|
|
92
226
|
* or undefined. Returns the target for chaining.
|
|
@@ -99,4 +233,424 @@ function mergeParams(target, source) {
|
|
|
99
233
|
Object.assign(target, source);
|
|
100
234
|
return target;
|
|
101
235
|
}
|
|
236
|
+
/* -------------------------------------------------------------------------- *
|
|
237
|
+
* `_MATCHES` ReDoS guard — assertSafeRegexPattern
|
|
238
|
+
* -------------------------------------------------------------------------- *
|
|
239
|
+
* The `_MATCHES` where-operator forwards its (bound) value into a Neo4j `=~`
|
|
240
|
+
* predicate, which the server evaluates with Java's *backtracking* regex
|
|
241
|
+
* engine. An attacker who can influence a `where` filter could otherwise
|
|
242
|
+
* supply a catastrophic-backtracking pattern (e.g. `(a+)+$`, `([a-z]+)+$`,
|
|
243
|
+
* `(a?)+$`, `(a|ab)*$`) and pin shared Neo4j CPU — a server-side ReDoS
|
|
244
|
+
* (CWE-1333). Parameterization stops *injection* but not this: the payload
|
|
245
|
+
* *is* the regex.
|
|
246
|
+
*
|
|
247
|
+
* DESIGN — SOUND BY CONSTRUCTION. A static blacklist ("detect the evil
|
|
248
|
+
* shapes, else accept") is fundamentally incomplete: there is always another
|
|
249
|
+
* evil family it misses. So this guard is inverted — it ACCEPTS a pattern
|
|
250
|
+
* only when it can *prove* the pattern is linear, and REJECTS everything
|
|
251
|
+
* else (fail-closed), including every construct it does not fully model.
|
|
252
|
+
* The cost is precision, not safety: some exotic-but-safe patterns are
|
|
253
|
+
* refused. That is the intended trade for a security guard on untrusted
|
|
254
|
+
* input; operators that only need substring/prefix/suffix semantics have
|
|
255
|
+
* dedicated, always-safe forms (`_CONTAINS` / `_STARTS_WITH` / `_ENDS_WITH`
|
|
256
|
+
* / `_IN`), and `_MATCHES` itself can be turned off entirely via
|
|
257
|
+
* `features.filters.String.MATCHES`.
|
|
258
|
+
*
|
|
259
|
+
* The proof sketch: after rejecting alternation, quantified groups, and any
|
|
260
|
+
* unsupported feature, an accepted pattern is a flat concatenation of
|
|
261
|
+
* single-atom matchers (non-quantified groups are transparent). In that
|
|
262
|
+
* shape the ONLY source of super-linear backtracking is two "loose"
|
|
263
|
+
* (variable-length or optional) quantifiers contending over an overlapping
|
|
264
|
+
* character set; the guard rejects unless every such pair is either over
|
|
265
|
+
* provably-disjoint character sets or separated by a required atom whose
|
|
266
|
+
* character set is provably disjoint from both (a hard fence). Both the
|
|
267
|
+
* parse and the pair check are single-pass / bounded (no regex is ever run
|
|
268
|
+
* against the input), so the guard cannot itself become a DoS vector.
|
|
269
|
+
*/
|
|
270
|
+
/** Longest `_MATCHES` pattern accepted — a shape-independent backstop. */
|
|
271
|
+
const MAX_MATCHES_PATTERN_LENGTH = 1000;
|
|
272
|
+
/** Most atoms a `_MATCHES` pattern may parse to — bounds the fence scan. */
|
|
273
|
+
const MAX_MATCHES_ATOMS = 256;
|
|
274
|
+
const BROAD_CHARSET = { kind: 'broad' };
|
|
275
|
+
const ranges = (...rs) => ({ kind: 'ranges', ranges: rs });
|
|
276
|
+
// Predefined ASCII classes (Java's default, non-Unicode semantics).
|
|
277
|
+
const CS_DIGIT = ranges([48, 57]); // \d
|
|
278
|
+
const CS_WORD = ranges([48, 57], [65, 90], [95, 95], [97, 122]); // \w
|
|
279
|
+
const CS_SPACE = ranges([9, 13], [32, 32]); // \s : \t \n \x0B \f \r space
|
|
280
|
+
/** All ASCII punctuation — the characters valid as a `\`-escaped literal. */
|
|
281
|
+
const ASCII_PUNCT = /[!-/:-@[-`{-~]/;
|
|
282
|
+
/** True only when two character sets are *provably* disjoint. */
|
|
283
|
+
function provablyDisjoint(a, b) {
|
|
284
|
+
if (a.kind === 'broad' || b.kind === 'broad')
|
|
285
|
+
return false;
|
|
286
|
+
for (const [al, ah] of a.ranges)
|
|
287
|
+
for (const [bl, bh] of b.ranges)
|
|
288
|
+
if (al <= bh && bl <= ah)
|
|
289
|
+
return false;
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Inline-flag characters accepted inside `(?…)` / `(?…:`. Deliberately ONLY
|
|
294
|
+
* the flags that provably do not change this analysis: `i` (modeled via
|
|
295
|
+
* caseFold), `m`/`d` (affect only where zero-width `^`/`$` match — never a
|
|
296
|
+
* fence), and `s` (affects only `.`, which is already `broad`). `x`
|
|
297
|
+
* (COMMENTS: whitespace/comments stripped → changes parsing) and `u`/`U`
|
|
298
|
+
* (Unicode-widen `\d\w\s` and Unicode case-folding beyond ASCII) are NOT
|
|
299
|
+
* modeled, so a group carrying them fails the flag scan and is refused
|
|
300
|
+
* fail-closed — otherwise e.g. `(?x)(a+) +` would parse as the exponential
|
|
301
|
+
* `(a+)+` on the server while looking benign here.
|
|
302
|
+
*/
|
|
303
|
+
const FLAG_CHARS = /[imsd-]/;
|
|
304
|
+
/**
|
|
305
|
+
* Fold ASCII letter case into a character set. Under a case-insensitive
|
|
306
|
+
* flag (`(?i)`) `a` also matches `A`, so disjointness must account for it —
|
|
307
|
+
* otherwise `A` could be mistaken for a fence between two `a`-matchers. We
|
|
308
|
+
* over-approximate (fold the whole pattern when `i` appears anywhere), which
|
|
309
|
+
* only ever merges sets and therefore stays sound.
|
|
310
|
+
*/
|
|
311
|
+
function caseFold(cs) {
|
|
312
|
+
if (cs.kind === 'broad')
|
|
313
|
+
return cs;
|
|
314
|
+
const out = [];
|
|
315
|
+
for (const [lo, hi] of cs.ranges) {
|
|
316
|
+
out.push([lo, hi]);
|
|
317
|
+
const uLo = Math.max(lo, 65);
|
|
318
|
+
const uHi = Math.min(hi, 90); // A–Z → +32
|
|
319
|
+
if (uLo <= uHi)
|
|
320
|
+
out.push([uLo + 32, uHi + 32]);
|
|
321
|
+
const lLo = Math.max(lo, 97);
|
|
322
|
+
const lHi = Math.min(hi, 122); // a–z → −32
|
|
323
|
+
if (lLo <= lHi)
|
|
324
|
+
out.push([lLo - 32, lHi - 32]);
|
|
325
|
+
}
|
|
326
|
+
return { kind: 'ranges', ranges: out };
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Assert that a `_MATCHES` regex pattern is provably free of catastrophic
|
|
330
|
+
* backtracking. Throws `OGMError` on anything it cannot prove linear. Only
|
|
331
|
+
* string values reach here; the value is already parameterized, so this is a
|
|
332
|
+
* semantic guard on the operator, never string interpolation.
|
|
333
|
+
*/
|
|
334
|
+
function assertSafeRegexPattern(pattern, context) {
|
|
335
|
+
const refuse = (why) => {
|
|
336
|
+
throw new errors_1.OGMError(`Unsafe \`_MATCHES\` pattern in ${context}: ${why}. ` +
|
|
337
|
+
`It cannot be proven free of catastrophic backtracking (ReDoS) and is refused. ` +
|
|
338
|
+
`Use a dedicated operator (_CONTAINS / _STARTS_WITH / _ENDS_WITH / _IN) where possible, ` +
|
|
339
|
+
`simplify the pattern, or disable the _MATCHES operator via features.filters.String.MATCHES if you must run arbitrary regexes and accept the risk.`);
|
|
340
|
+
};
|
|
341
|
+
// 1. Length cap first — O(1), and bounds every step that follows.
|
|
342
|
+
if (pattern.length > MAX_MATCHES_PATTERN_LENGTH)
|
|
343
|
+
refuse(`pattern exceeds ${MAX_MATCHES_PATTERN_LENGTH} characters`);
|
|
344
|
+
// 2. Parse into a flat atom list, rejecting anything not fully modeled.
|
|
345
|
+
const parsed = parseLinearAtomsOrRefuse(pattern, refuse);
|
|
346
|
+
const atoms = parsed.caseInsensitive
|
|
347
|
+
? parsed.atoms.map((a) => ({ ...a, charset: caseFold(a.charset) }))
|
|
348
|
+
: parsed.atoms;
|
|
349
|
+
// Hard atom cap — bounds the O(atoms^3) fence scan below to a few ms even
|
|
350
|
+
// on a fully-fenced adversarial pattern. No realistic filter regex has this
|
|
351
|
+
// many atoms; refusing one is a fail-closed backstop, not a real limit.
|
|
352
|
+
if (atoms.length > MAX_MATCHES_ATOMS)
|
|
353
|
+
refuse(`pattern has too many components (>${MAX_MATCHES_ATOMS})`);
|
|
354
|
+
// 3. Loose-pair rule: no two loose atoms may contend over an overlapping
|
|
355
|
+
// character set unless a hard fence provably separates them.
|
|
356
|
+
for (let i = 0; i < atoms.length; i++) {
|
|
357
|
+
const a = atoms[i];
|
|
358
|
+
if (!a.loose)
|
|
359
|
+
continue;
|
|
360
|
+
for (let j = i + 1; j < atoms.length; j++) {
|
|
361
|
+
const b = atoms[j];
|
|
362
|
+
if (!b.loose)
|
|
363
|
+
continue;
|
|
364
|
+
if (provablyDisjoint(a.charset, b.charset))
|
|
365
|
+
continue;
|
|
366
|
+
let fenced = false;
|
|
367
|
+
for (let k = i + 1; k < j; k++) {
|
|
368
|
+
const m = atoms[k];
|
|
369
|
+
if (m.required &&
|
|
370
|
+
provablyDisjoint(m.charset, a.charset) &&
|
|
371
|
+
provablyDisjoint(m.charset, b.charset)) {
|
|
372
|
+
fenced = true;
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (!fenced)
|
|
377
|
+
refuse('two variable-length quantifiers can contend over the same input');
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Parse a regex into a flat list of single-atom matchers, inlining
|
|
383
|
+
* non-quantified groups and REFUSING on any construct outside the provably
|
|
384
|
+
* modelable subset (alternation, quantified groups, lookaround, named
|
|
385
|
+
* groups, backreferences, unrecognized escapes, unbalanced brackets, stray
|
|
386
|
+
* quantifiers). Single forward pass — O(n), no backtracking.
|
|
387
|
+
*/
|
|
388
|
+
function parseLinearAtomsOrRefuse(pattern, refuse) {
|
|
389
|
+
const atoms = [];
|
|
390
|
+
const n = pattern.length;
|
|
391
|
+
let depth = 0; // open non-quantified groups
|
|
392
|
+
let caseInsensitive = false;
|
|
393
|
+
let i = 0;
|
|
394
|
+
while (i < n) {
|
|
395
|
+
const c = pattern[i];
|
|
396
|
+
// Anchors (zero-width) — not atoms, and not fences.
|
|
397
|
+
if (c === '^' || c === '$') {
|
|
398
|
+
i++;
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
// Word-boundary anchors.
|
|
402
|
+
if (c === '\\' && (pattern[i + 1] === 'b' || pattern[i + 1] === 'B')) {
|
|
403
|
+
i += 2;
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
// Alternation — not modeled; refuse.
|
|
407
|
+
if (c === '|')
|
|
408
|
+
refuse('alternation (`|`) is not supported');
|
|
409
|
+
// Group open — plain `(`, non-capturing `(?:`, or inline-flag groups.
|
|
410
|
+
if (c === '(') {
|
|
411
|
+
if (pattern[i + 1] === '?') {
|
|
412
|
+
if (pattern[i + 2] === ':') {
|
|
413
|
+
depth++;
|
|
414
|
+
i += 3;
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
// `(?flags)` (zero-width) or `(?flags:...)` (scoped). Any other
|
|
418
|
+
// `(?…)` — lookaround, named, atomic — is refused (fail-closed).
|
|
419
|
+
let j = i + 2;
|
|
420
|
+
while (j < n && FLAG_CHARS.test(pattern[j]))
|
|
421
|
+
j++;
|
|
422
|
+
if (j > i + 2 && (pattern[j] === ')' || pattern[j] === ':')) {
|
|
423
|
+
if (pattern.slice(i + 2, j).includes('i'))
|
|
424
|
+
caseInsensitive = true;
|
|
425
|
+
if (pattern[j] === ')')
|
|
426
|
+
i = j + 1; // zero-width flag setting — emits no atom
|
|
427
|
+
else {
|
|
428
|
+
depth++;
|
|
429
|
+
i = j + 1; // scoped-flag group behaves like a plain group
|
|
430
|
+
}
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
refuse('lookaround, named, atomic, or unsupported group syntax');
|
|
434
|
+
}
|
|
435
|
+
depth++;
|
|
436
|
+
i++;
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
// Group close — refuse a quantifier applied to the group.
|
|
440
|
+
if (c === ')') {
|
|
441
|
+
if (depth === 0)
|
|
442
|
+
refuse('unbalanced `)`');
|
|
443
|
+
depth--;
|
|
444
|
+
const q = pattern[i + 1];
|
|
445
|
+
if (q === '*' || q === '+' || q === '?' || q === '{')
|
|
446
|
+
refuse('a quantified group cannot be proven linear');
|
|
447
|
+
i++;
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
// Otherwise: an atom (with an optional quantifier).
|
|
451
|
+
const atom = parseAtomOrRefuse(pattern, i, refuse);
|
|
452
|
+
const quant = parseQuantifier(pattern, atom.next);
|
|
453
|
+
atoms.push({
|
|
454
|
+
charset: atom.charset,
|
|
455
|
+
loose: quant.max !== quant.min || quant.min === 0,
|
|
456
|
+
required: quant.min >= 1,
|
|
457
|
+
});
|
|
458
|
+
i = quant.next;
|
|
459
|
+
}
|
|
460
|
+
if (depth !== 0)
|
|
461
|
+
refuse('unbalanced `(`');
|
|
462
|
+
return { atoms, caseInsensitive };
|
|
463
|
+
}
|
|
464
|
+
/** Parse a single atom's character set. Returns the index after the atom. */
|
|
465
|
+
function parseAtomOrRefuse(p, i, refuse) {
|
|
466
|
+
const c = p[i];
|
|
467
|
+
if (c === '*' || c === '+' || c === '?' || c === '{' || c === '}')
|
|
468
|
+
refuse('quantifier or brace with no preceding atom');
|
|
469
|
+
if (c === '.')
|
|
470
|
+
return { charset: BROAD_CHARSET, next: i + 1 };
|
|
471
|
+
if (c === '[')
|
|
472
|
+
return parseClassOrRefuse(p, i, refuse);
|
|
473
|
+
if (c === '\\')
|
|
474
|
+
return parseEscapeOrRefuse(p, i, refuse);
|
|
475
|
+
// Ordinary literal character.
|
|
476
|
+
return { charset: ranges([c.charCodeAt(0), c.charCodeAt(0)]), next: i + 1 };
|
|
477
|
+
}
|
|
478
|
+
/** Parse a `\`-escape at index `i` (points at the backslash). */
|
|
479
|
+
function parseEscapeOrRefuse(p, i, refuse) {
|
|
480
|
+
if (i + 1 >= p.length)
|
|
481
|
+
refuse('trailing backslash');
|
|
482
|
+
const e = p[i + 1];
|
|
483
|
+
switch (e) {
|
|
484
|
+
case 'd':
|
|
485
|
+
return { charset: CS_DIGIT, next: i + 2 };
|
|
486
|
+
case 'w':
|
|
487
|
+
return { charset: CS_WORD, next: i + 2 };
|
|
488
|
+
case 's':
|
|
489
|
+
return { charset: CS_SPACE, next: i + 2 };
|
|
490
|
+
case 'D':
|
|
491
|
+
case 'W':
|
|
492
|
+
case 'S':
|
|
493
|
+
return { charset: BROAD_CHARSET, next: i + 2 }; // complement — broad
|
|
494
|
+
case 'n':
|
|
495
|
+
return { charset: ranges([10, 10]), next: i + 2 };
|
|
496
|
+
case 'r':
|
|
497
|
+
return { charset: ranges([13, 13]), next: i + 2 };
|
|
498
|
+
case 't':
|
|
499
|
+
return { charset: ranges([9, 9]), next: i + 2 };
|
|
500
|
+
case 'f':
|
|
501
|
+
return { charset: ranges([12, 12]), next: i + 2 };
|
|
502
|
+
case 'v':
|
|
503
|
+
// Java (JDK 8+): `\v` is the vertical-whitespace CLASS (includes \n),
|
|
504
|
+
// NOT the single vertical tab it is in JavaScript. Under-modeling it as
|
|
505
|
+
// one char would let `\n*\v*` slip the loose-pair check while Java's
|
|
506
|
+
// engine backtracks on the shared newline — so model it as broad.
|
|
507
|
+
return { charset: BROAD_CHARSET, next: i + 2 };
|
|
508
|
+
default: {
|
|
509
|
+
// `\0`, `\1`…`\9` — octal escapes / backreferences. Java's octal rule
|
|
510
|
+
// (`\0` + 1–3 octal digits) differs from JS and would let the trailing
|
|
511
|
+
// digits mis-parse (e.g. Java reads `\011` as one TAB, inside `\s`); a
|
|
512
|
+
// backreference we cannot model. Refuse all `\<digit>` (fail-closed).
|
|
513
|
+
// Escaped ASCII punctuation → the literal character.
|
|
514
|
+
if (ASCII_PUNCT.test(e))
|
|
515
|
+
return {
|
|
516
|
+
charset: ranges([e.charCodeAt(0), e.charCodeAt(0)]),
|
|
517
|
+
next: i + 2,
|
|
518
|
+
};
|
|
519
|
+
// Backreferences, \x, \u, \p, \k, \Q…\E, and any other escape are not
|
|
520
|
+
// modeled — refuse (fail-closed).
|
|
521
|
+
return refuse(`unsupported escape \`\\${e}\``);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
/** Parse a `[...]` character class. Returns the index after the closing `]`. */
|
|
526
|
+
function parseClassOrRefuse(p, start, refuse) {
|
|
527
|
+
let i = start + 1;
|
|
528
|
+
let negated = false;
|
|
529
|
+
if (p[i] === '^') {
|
|
530
|
+
negated = true;
|
|
531
|
+
i++;
|
|
532
|
+
}
|
|
533
|
+
const rs = [];
|
|
534
|
+
let broad = false;
|
|
535
|
+
let first = true;
|
|
536
|
+
while (i < p.length) {
|
|
537
|
+
const c = p[i];
|
|
538
|
+
// A `]` closes the class — unless it is the very first member (Java
|
|
539
|
+
// treats a leading `]` as a literal).
|
|
540
|
+
if (c === ']' && !first) {
|
|
541
|
+
i++;
|
|
542
|
+
if (negated || broad)
|
|
543
|
+
return { charset: BROAD_CHARSET, next: i };
|
|
544
|
+
return { charset: ranges(...rs), next: i };
|
|
545
|
+
}
|
|
546
|
+
first = false;
|
|
547
|
+
if (c === '[')
|
|
548
|
+
refuse('nested character class is not supported');
|
|
549
|
+
if (c === '&' && p[i + 1] === '&')
|
|
550
|
+
refuse('character-class intersection (`&&`) is not supported');
|
|
551
|
+
// One class member → its low code point (and its index advance).
|
|
552
|
+
let low;
|
|
553
|
+
if (c === '\\') {
|
|
554
|
+
if (i + 1 >= p.length)
|
|
555
|
+
refuse('trailing backslash in character class');
|
|
556
|
+
const e = p[i + 1];
|
|
557
|
+
if (e === 'd' || e === 'w' || e === 's') {
|
|
558
|
+
const set = e === 'd' ? CS_DIGIT : e === 'w' ? CS_WORD : CS_SPACE;
|
|
559
|
+
if (set.kind === 'ranges')
|
|
560
|
+
rs.push(...set.ranges);
|
|
561
|
+
i += 2;
|
|
562
|
+
continue;
|
|
563
|
+
}
|
|
564
|
+
// `\v` (Java vertical-whitespace class) and the negated/property
|
|
565
|
+
// classes broaden the set beyond a finite positive range we model.
|
|
566
|
+
if (e === 'D' ||
|
|
567
|
+
e === 'W' ||
|
|
568
|
+
e === 'S' ||
|
|
569
|
+
e === 'p' ||
|
|
570
|
+
e === 'P' ||
|
|
571
|
+
e === 'v') {
|
|
572
|
+
broad = true;
|
|
573
|
+
i += 2;
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
const lit = {
|
|
577
|
+
n: 10,
|
|
578
|
+
r: 13,
|
|
579
|
+
t: 9,
|
|
580
|
+
f: 12,
|
|
581
|
+
};
|
|
582
|
+
if (e in lit)
|
|
583
|
+
low = lit[e];
|
|
584
|
+
else if (ASCII_PUNCT.test(e))
|
|
585
|
+
low = e.charCodeAt(0);
|
|
586
|
+
else
|
|
587
|
+
return refuse(`unsupported escape \`\\${e}\` in character class`);
|
|
588
|
+
i += 2;
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
low = c.charCodeAt(0);
|
|
592
|
+
i++;
|
|
593
|
+
}
|
|
594
|
+
// Optional range `low-high` (a `-` not immediately before the closing `]`).
|
|
595
|
+
if (p[i] === '-' && i + 1 < p.length && p[i + 1] !== ']') {
|
|
596
|
+
const hc = p[i + 1];
|
|
597
|
+
let high;
|
|
598
|
+
if (hc === '\\') {
|
|
599
|
+
if (i + 2 < p.length && ASCII_PUNCT.test(p[i + 2]))
|
|
600
|
+
high = p[i + 2].charCodeAt(0);
|
|
601
|
+
else
|
|
602
|
+
return refuse('unsupported range endpoint in character class');
|
|
603
|
+
i += 3;
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
high = hc.charCodeAt(0);
|
|
607
|
+
i += 2;
|
|
608
|
+
}
|
|
609
|
+
if (high < low)
|
|
610
|
+
refuse('inverted range in character class');
|
|
611
|
+
rs.push([low, high]);
|
|
612
|
+
}
|
|
613
|
+
else
|
|
614
|
+
rs.push([low, low]);
|
|
615
|
+
}
|
|
616
|
+
return refuse('unterminated character class');
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Parse a quantifier at index `i` (the position just after an atom). Returns
|
|
620
|
+
* the repetition bounds and the index after the quantifier (and any lazy `?`
|
|
621
|
+
* or possessive `+` modifier). No quantifier → exactly-once `(1,1)`.
|
|
622
|
+
*/
|
|
623
|
+
function parseQuantifier(p, i) {
|
|
624
|
+
const c = p[i];
|
|
625
|
+
let min;
|
|
626
|
+
let max;
|
|
627
|
+
let next;
|
|
628
|
+
if (c === '*')
|
|
629
|
+
[min, max, next] = [0, Infinity, i + 1];
|
|
630
|
+
else if (c === '+')
|
|
631
|
+
[min, max, next] = [1, Infinity, i + 1];
|
|
632
|
+
else if (c === '?')
|
|
633
|
+
[min, max, next] = [0, 1, i + 1];
|
|
634
|
+
else if (c === '{') {
|
|
635
|
+
const m = /^\{(\d+)(?:(,)(\d*))?\}/.exec(p.slice(i));
|
|
636
|
+
if (!m)
|
|
637
|
+
return { min: 1, max: 1, next: i }; // literal `{` — treat atom as exact
|
|
638
|
+
min = Number(m[1]);
|
|
639
|
+
const comma = m[2];
|
|
640
|
+
const upper = m[3];
|
|
641
|
+
if (comma === undefined)
|
|
642
|
+
max = min;
|
|
643
|
+
else if (upper === undefined || upper === '')
|
|
644
|
+
max = Infinity;
|
|
645
|
+
else
|
|
646
|
+
max = Number(upper);
|
|
647
|
+
next = i + m[0].length;
|
|
648
|
+
}
|
|
649
|
+
else
|
|
650
|
+
return { min: 1, max: 1, next: i };
|
|
651
|
+
// Consume an optional lazy (`?`) or possessive (`+`) modifier.
|
|
652
|
+
if (p[next] === '?' || p[next] === '+')
|
|
653
|
+
next++;
|
|
654
|
+
return { min, max, next };
|
|
655
|
+
}
|
|
102
656
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":";;AAQA,sCAKC;AAgBD,wDAGC;AASD,oDAKC;AAeD,4CAIC;AAKD,0CAGC;AAKD,kDAMC;AAMD,sCAIC;AASD,kCAMC;AA7GD,sCAAqC;AAErC,uEAAuE;AACvE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;AAExE;;GAEG;AACH,SAAgB,aAAa,CAAC,GAAW,EAAE,OAAe;IACxD,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC;QACvB,MAAM,IAAI,iBAAQ,CAChB,8BAA8B,GAAG,QAAQ,OAAO,4BAA4B,CAC7E,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,sBAAsB,CAAC,IAAY,EAAE,OAAe;IAClE,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7B,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,yCAAyC;AACzC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAa,EAAE,OAAe;IACjE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;QAC9B,MAAM,IAAI,iBAAQ,CAChB,uBAAuB,KAAK,QAAQ,OAAO,sDAAsD,CAClG,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;GA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CAAC,CAAC;QACrD,IAAI,CAAC,CAAC;YAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,oCAAoC;QAChF,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAuB,CAAC;QACzC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAuB,CAAC;QACzC,IAAI,KAAK,KAAK,SAAS;YAAE,GAAG,GAAG,GAAG,CAAC;aAC9B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;YAAE,GAAG,GAAG,QAAQ,CAAC;;YACxD,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACzB,CAAC;;QAAM,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAE1C,+DAA+D;IAC/D,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG;QAAE,IAAI,EAAE,CAAC;IAC/C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fulltext.compiler.d.ts","sourceRoot":"","sources":["../../../src/compilers/fulltext.compiler.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"fulltext.compiler.d.ts","sourceRoot":"","sources":["../../../src/compilers/fulltext.compiler.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAkChF,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,cAAc;IAE1C;;;OAGG;IACH,OAAO,CACL,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,SAAM,GACZ,cAAc;IAqBjB;;;OAGG;IACH,mBAAmB,CACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC5D,QAAQ,EAAE,aAAa,EACvB,MAAM,SAAM,GACX,cAAc;IAgDjB,OAAO,CAAC,WAAW;IAmDnB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAqCnB,+EAA+E;IAC/E,OAAO,CAAC,gBAAgB;IAoCxB;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAgFhC;;OAEG;IACH,OAAO,CAAC,SAAS;IAiDjB;;;OAGG;IACH,OAAO,CAAC,UAAU;IA8DlB;;;OAGG;IACH,OAAO,CAAC,UAAU;CA2BnB"}
|