sparql: SPARQL 1.1 (UNION/MINUS/BIND/VALUES/aggregation) + loud rejection (v0.4.5)#27
Open
mdheller wants to merge 2 commits into
Open
sparql: SPARQL 1.1 (UNION/MINUS/BIND/VALUES/aggregation) + loud rejection (v0.4.5)#27mdheller wants to merge 2 commits into
mdheller wants to merge 2 commits into
Conversation
…(2 high) - sparql.ts (js/remote-property-injection x2): PREFIX names and SELECT variable names come straight from the query text and were written to plain objects (this.prefixes[prefix], row[v]) — prototype pollution via __proto__/constructor. Added an isSafeKey() guard on both writes. - masking.ts (js/insufficient-password-hash): StaticKeyProvider.fromPassphrase derived the AES-256 key with a bare SHA-256; replaced with a memory-hard KDF (scryptSync, fixed domain salt so it stays deterministic for reversible masking). NOTE: changes the derived key vs the old scheme — data masked under SHA-256 must be re-masked. The atomspace SHA-1 weak-crypto alert (#6) was dismissed separately as a false positive: it's content-addressing (atom identity), not a security hash. 165 tests green; tsc clean; bundle rebuilt.
…d + loud rejection of unsupported forms (v0.4.5) The evaluator silently mis-parsed UNION/MINUS/BIND/VALUES/SERVICE/GRAPH into empty results. Adds real support for UNION, MINUS (antijoin), BIND (arith+CONCAT/STR), VALUES, and COUNT/SUM/AVG/MIN/MAX with GROUP BY; 'a' now expands to rdf:type; and unsupported query forms throw an explicit error instead of returning silently-wrong empties. 182 tests green.
| const bindings: Binding[] = [] | ||
| for (const rows of groups.values()) { | ||
| const out: Binding = {} | ||
| for (const g of groupBy) out[g] = rows[0]?.[g] ?? null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds UNION, MINUS, BIND (arith+CONCAT/STR), VALUES, COUNT/SUM/AVG/MIN/MAX + GROUP BY, 'a'→rdf:type. Unsupported forms throw instead of silently-wrong empties. 182 tests green. Re-vendored into prophet-platform#787.