Repository navigation
v0.13.0
The platform runs on Neo4j 5 as well as Memgraph. The compose bundle picks the database with
DB_ENGINE (Memgraph stays the default), dt-ws builds its schema in each engine's dialect, and the
Cypher statements Neo4j refused now run on both engines. @dethernety/dt-module gains the engine,
schema and write-lock helpers modules need to do the same. byodt is 1.3.0.
dt-ui no longer fetches every module frontend before it mounts. A module frontend is now a bundle
and a manifest naming the component keys it registers, and dt-ui fetches a module's bundle the first
time one of those keys is needed, from a content-addressed URL the browser caches. dt-ws reads each
bundle once, when it loads the module, and serves it from memory.
Upgrading: an existing deployment stays on Memgraph: the first byodt command that runs the
stack records DB_ENGINE=memgraph in .env. Run the stack through byodt only: compose.yaml
no longer holds the db service, so a bare docker compose up does not start the stack. Local
compose changes are read from compose.override.yaml only; rename a compose.override.yml or
docker-compose.override.*. API callers and module authors: a list property value that holds
null is now refused (see Changed), and so are a single filter on a relationship to an interface
or union and requests past the new request limits (see Security); getAvailableFrontendModules
and getModuleFrontendBundle are removed (see Removed). Module authors: a module frontend
without frontend/frontend-manifest.json is no longer loaded (see Changed);
dethernety-threat-report 2.0.1 ships its manifest. Operators: update each installed module
that has a frontend to a version that ships frontend/frontend-manifest.json, before you upgrade
the platform or right after it: 0.13.0 no longer loads a module frontend without its manifest.
Reload any browser tab left open across the upgrade: an old tab still runs the old dt-ui, which
calls the removed frontend queries. A CDN or reverse proxy in front of dt-ws must honour
Cache-Control: private on /module-bundles/ and must not cache it by
path (see Security). Dethereal users: builds before the next Dethereal release send a filter
the platform now refuses, so listing analyses from them fails until you update Dethereal, and they
send one operand per element when they assign a control, so assigning one to some 200 elements or
more in one call is refused too; Dethereal 0.4.17 bundles the fixed dt-core and carries the updated
data layer: dt-core's module queries gain getFrontendModuleManifest and lose
getAvailableFrontendModules and getModuleFrontendBundle. 0.4.16 was never published: its changes
ship in 0.4.17.
Added
- Neo4j 5 as the bundle's database. Set
DB_ENGINE=neo4jin.envbefore the first start, or
runDB_ENGINE=neo4j ./byodt uponce, to run Neo4j 5.26 Community instead of Memgraph.byodt
records the engine in.envon the first run, andNEO4J_IMAGEon the first Neo4j run; an
exportedDB_ENGINEoverrides.envfor one command. New optional settings:NEO4J_HEAP_SIZE
(default2G),NEO4J_PAGECACHE_SIZE(default1G) andNEO4J_DATA(./data/neo4j, or the
neo4j-datanamed volume). On Neo4j the platform connects as userneo4jto databaseneo4j;
NEO4J_USERNAMEandNEO4J_DATABASEin.envapply to Memgraph only. See the deploy README,
Choosing the database. - Each engine keeps its own data. Nothing converts one engine's graph into the other.
byodt
refuses to start an engine whose bind-mounted store is empty while the other engine's store holds
data, and runs the same check before a backup or a restore. A refused start leaves.envand
data/as they were. A store in a named volume is not checked. - Backup and restore on Neo4j. Neo4j Community dumps and loads an offline database only, so
./byodt backupand./byodt restorestopdb, runneo4j-adminin a one-off container through
a private (0700) working directory in the bundle, and startdbagain, also when the dump or load
fails. The platform loses its database connection meanwhile. Each engine refuses the other
engine's backup file. A failed Neo4j load may leave the graph empty: restore again from a backup
you know is good. - Engine detection in
@dethernety/dt-module.probeEngine(driver, databaseName?)reads
dbms.components()and returns anEngineInfo(engine:'memgraph' | 'neo4j',edition,
version). It throwsEngineProbeErrorfor a component that names neither engine, rather than
guessing.resolveEngine(context)returns a module resolver context's engine: through
getEnginewhen the platform supplies it, otherwise through one probe of the context's driver,
kept per driver. It always rejects on failure, never throws synchronously. ModuleResolverContext.getEngine(optional). dt-ws now supplies it to every module's
getResolvers(), backed by the platform's single engine probe. It rejects when the engine cannot
be determined. CallresolveEngine(context)to also work on a platform that predates it.- Per-engine schema DDL builders in
@dethernety/dt-module.buildIndexDdl,
buildDropIndexDdl,buildRelationshipIndexDdl,buildDropRelationshipIndexDdl,
buildConstraintDdl(single or composite uniqueness, or existence) andbuildDropConstraintDdl
return the statement for the givenEngineInfo. Every Neo4j index and constraint gets a
deterministic name (indexName,relationshipIndexName,constraintName), because Neo4j 5
drops schema objects by name only. Labels and properties must be plain identifiers. An unknown
constraint kind throws. An existence constraint builds asnullon Neo4j editions other than
Enterprise. ensureSchema(run, engineInfo, plan)anddropSchemaObject(run, engineInfo, target)apply
and drop a module's declared indexes, relationship indexes and constraints on either engine, and
return aSchemaReport(applied,existed,skipped,failed).ensureSchemachecks every
spec before it runs anything. On Memgraph "already exists" counts as present. On Neo4j a plain
index that a uniqueness constraint or node key covers is skipped, and one in the way of a declared
constraint is dropped first and put back if the constraint fails. Before each uniqueness
constraint it counts duplicate key values and nodes missing the key; with duplicates the
constraint is not attempted and is reported as failed with both counts. Applying the same plan
twice changes nothing. On Neo4jdropSchemaObjectlooks up every matching object with
SHOW INDEXES/SHOW CONSTRAINTSand drops it by its actual name, so unnamed objects from
earlier versions go too; a name that is not a plain word is refused and reported, not quoted.writeLockClause(variable)in@dethernety/dt-modulereturnsSET v._lock = true REMOVE v._lock. Put it right after theMATCHof a node that a statement reads and then writes: on
Neo4j a concurrent writer waits and then reads the committed state; on Memgraph it conflicts, and
a driver-managed write transaction retries it. Nothing is left on the node.@dethernety/dt-module/cypher-lint(dev and test tooling): a text-based check for the one
aggregation rule Neo4j 5 enforces and Memgraph does not ("Aggregation column contains implicit
grouping expressions"). It exportsaggregationKeyViolations,aggregationKeyViolationsInFiles,
cypherStringsInSource,cypherStatementsInSchema,cypherLintFiles,cypherProjectionsand
formatAggregationKeyViolation. The dt-ws, threat-report and coverage-tools lint tests run it
over their sources and schema@cypherstatements.- The integration suites run on Neo4j.
DT_TEST_ENGINE=memgraph|neo4jpicks the engine of the
test database for the dt-ws and threat-report suites; any other value is refused. Onneo4jthe
suites start Neo4j 5.26 Community, skip the Memgraph-only suites with their reason, and write
every server failure to stderr. See the backend LLD architecture, Running the suites on Neo4j. - CI: a Neo4j test leg, run by hand. The
neo4j-legworkflow (workflow_dispatchonly) runs
the dt-ws and threat-report suites on Memgraph and on Neo4j. Its log gate
(.github/scripts/neo4j-log-gate.sh) fails the leg when a suite's output is missing, shows no
passed test, or holds aNeo.ClientError.Statement,.Procedureor.Schemacode that no line
of.github/neo4j-log-gate-allow.txtallows. The gate's own fixture test runs on every pull
request, and the bundle job now checks the compose configuration under both engines. - Integration suites can run against an external test database. On a machine where containers
cannot run, the dt-ws and threat-report integration suites share one throwaway database instead of
starting a container per suite:MEMGRAPH_TEST_URInames a test Memgraph,NEO4J_TEST_URIa test
Neo4j (withDT_TEST_ENGINE=neo4j). The check and the reset live in the new
@dethernety/dt-module/test-databasesubpath (dev/test only; nothing in the package's main entry
imports it). Each suite resets the database when it connects, so run the suites one at a time (jest
--runInBand, vitest--no-file-parallelism) and one package at a time. See the backend LLD
architecture, Running the suites against an external test database. - A guard runs before anything is wiped. The URI must be a plain
bolt://host:port, must not use
port 7687 (always refused) and must be listed exactly inDT_TEST_EXTERNAL_WIPE. The server must
identify itself as a test database: a Memgraph by the server name it was started with, a Neo4j
(the weaker check) by running without auth and with its default database namedmemgraph. A
database holding an index or constraint kind the suites never create is refused untouched. - Every dt-core GraphQL document is checked against the schema.
apps/dt-ws/src/gql/__tests__/dt-core-documents.spec.tsvalidates each document dt-core exports
against the schema the platform serves, built in process with no database, and checks thewhere
shapes dt-core's filter builders produce with the same variable coercion a request goes through.
A field or argument the schema does not have fails the test instead of the request. - The module frontend manifest.
frontend/frontend-manifest.json, besidefrontend/bundle.js:
manifestVersion(1),components(the component keysinstall()registers, exactly: 1 to 256
unique keys matching^[A-Za-z][A-Za-z0-9_-]{0,127}$) andhostApi({ min, max }, integers
from 1 to 1000,min≤max: the host dependency versions the bundle works with). The host's
version is 1.@dethernety/dt-moduleexportsvalidateFrontendManifest,parseFrontendManifest,
FrontendManifestErrorand the JSON schema (@dethernety/dt-module/frontend-manifest.schema.json). assertFrontendManifest, on@dethernety/dt-module/frontend-manifest: the contract test for a
module frontend. It runsinstall()against a recording registry and throws unless it registers
exactly the manifest's keys, each once. It works under any test runner. The threat report
module's suite runs it in CI.getFrontendModuleManifest(@authentication): per module on the module allow-list with a
frontend, sorted by name, itsname,version,available,hash(sha256 of the bundle),size,
url,componentsandhostApi. No bundle text. dt-core:DtModule.getFrontendModuleManifest()
and theFrontendModuleManifesttype;AnalysisClass.moduleis unwrapped like the class.GET /module-bundles/:name/:hash/bundle.js: a module's bundle, behindJwtAuthGuard.404
for an unknown module, one without a frontend or one not on the module allow-list;503while the
module is unhealthy;404when:hashis not the current bundle's sha256; otherwise200withCache-Control: private, max-age=31536000, immutable,Vary: Accept-Encodingand an ETag per encoding (brotli, gzip or
none), and304on a matchingIf-None-Match. The dt-ui dev server proxies/module-bundlesto
dt-ws.- User Timing marks in dt-ui.
dt:mount(fromdt:boottodt:mounted),dt:module:<name>for
each module frontend load, anddt:view:<key>from an analysis result's fetch to its module
component rendering it. Each measure carriesdetail.ok,falsefor a failed load. Read them with
performance.getEntriesByType('measure').
Changed
-
The bundle's database sends no usage data to its vendor.
compose.memgraph.yamlstarts
Memgraph with--telemetry-enabled=false, andcompose.neo4j.yamlsets Neo4j's
dbms.usage_report.enabledtofalse; both images report usage by default../byodt restart db
applies it to a running deployment. -
Breaking (API callers and module authors): a list property value may not hold null. Neo4j
refuses such a list and Memgraph stores it, so dt-ws now refuses it on every write path, before the
database sees it. A list element that isnull,undefinedor an array hole is refused; an empty
list, an empty string in a list, and a top-levelnull(which clears the attribute) are still
accepted.setInstantiationAttributesfails withVALIDATION_ERROR, naming the attribute and the element:
Invalid request: attributes.<key>: list element <i> is null; remove the empty entry (a list cannot hold null). Nothing is written.- A module finding's attribute holding such a list is dropped with a warning and the finding is
still written; a finding whose name cannot be stored is skipped. The same goes for a MITRE
edge attribute. - At module install, a class whose properties hold such a list fails, which leaves the install
partial as any class failure does; module metadata holding one fails the install.
-
Breaking (operators who run compose directly or keep another override file name): the bundle's
dbservice moved out ofcompose.yamlintocompose.memgraph.yamlandcompose.neo4j.yaml,
under the same service name.byodtpassescompose.yaml, the engine's file, then
compose.override.yamlwhen there is one, last. A baredocker compose uponcompose.yamlno
longer starts the stack: use./byodt compose …for anythingbyodthas no command for.
compose.override.ymlanddocker-compose.override.*are no longer loaded;byodtwarns when it
finds one. -
The tested Neo4j image names its patch release:
docker.io/library/neo4j:5.26.32-community.
The first Neo4j run records it asNEO4J_IMAGEin.env, wherebyodtused to record the
floatingdocker.io/library/neo4j:5.26-community. A deployment that recorded the floating tag
keeps it:./byodt upand./byodt updatewarn that it differs from the tested image, and start
as before. Moving is your call: back up first (./byodt backup; there is no downgrade), set
NEO4J_IMAGE, then run./byodt update. -
The platform asks the database once which engine it is. dt-ws's
DatabaseServiceholds the
only engine probe, now dt-module'sprobeEngine; the module registry, the class reconciler and
the schema bootstrap share it. Adbms.components()answer that names neither engine is now an
error, where it used to be taken for Neo4j:getEnginerejects, and the schema bootstrap, as on
any failed probe, assumes Memgraph and logs the error. On Neo4j the class reconciler no longer
callsmg.procedures(). -
Bootstrap schema statements come from dt-module's builders. dt-ws's index and constraint
bootstrap builds each statement with the dt-module DDL builders, so every index and constraint it
creates on Neo4j now carries its deterministicdt_…name. A builder error counts against that
statement, and the rest of the bootstrap still runs. -
Bootstrap drops the old class vector indexes on Memgraph. Earlier versions kept a vector index
on each class label (component_,control_,dataflow_,boundary_and
data_class_embeddings). Class matching is an exact scan and reads none of them; they only held
memory and slowed every class write. Those thatvector_search.show_index_info()lists are dropped
once the index and constraint bootstrap has finished. A MITRE vector index is never touched. A
failed listing or drop is a warning and never stops startup; Neo4j never had these indexes. -
The MITRE vector-index upkeep says when it skips. It runs on Memgraph only, as before; on
another engine it now logs that it is skipped, once per process. -
The console indexes the reference-data keys before the ingest.
console-initprobes the
engine and creates an index on every label and key the MITRE corpus is looked up by, in that
engine's dialect and, on Neo4j, under the name the platform gives the same index, so the ingest's
writes no longer scan whole labels. A failed index, or an engine it cannot tell, never fails the
ingest; it is noted in the ingest state's detail. The MITRE embeddings build's loader
(modules/mitre-frameworks/scripts/load_committed_data.py) creates its key indexes per engine the
same way. -
The console names a Neo4j memory failure as one. Neo4j's out-of-memory codes (heap,
transaction pool, transaction limit) are terminal and not retried, like Memgraph's memory-limit
error, and the hint names the setting to raise on the engine the ingest ran against
(NEO4J_HEAP_SIZEon Neo4j). -
Breaking (anyone using
MEMGRAPH_TEST_URI): the variable now also needs the URI listed in
DT_TEST_EXTERNAL_WIPE, a port other than 7687, and a Memgraph started with
--bolt-server-name-for-init=dt-test-memgraph. A target that does not meet all three is refused. -
Breaking (module authors): a module frontend needs
frontend/frontend-manifest.json. Without
a valid manifest, dt-ws does not load the frontend and logsModule frontend not loadedwith the
module name and the reason; the module itself still loads. To add one, list the keys your
install()passes tocomponentRegistry.register():{ "manifestVersion": 1, "components": ["my_component"], "hostApi": { "min": 1, "max": 1 } }Then add a test that calls
assertFrontendManifest(frontend, manifest), and repackage.
scripts/package-module.jsnow refuses, and produces no package for, afrontend/that is not a
directory (a symlink), lacks either file, holds a symlink in their place, or has a manifest that is
not valid JSON or not a JSON object. It copies
the manifest into the package before the identity stamp, sopayloadDigestcovers it. -
dt-ui loads module frontends on first use.
ModuleLoader.ensure(key)reads the manifest on
first use, then fetches the owning module's bundle once. A401refreshes the token and retries
once; a404(a stale hash) rereads the manifest once; a503oravailable: falseis reported
as unavailable; a module whosehostApirange excludes the host's version is refused. A failed
load is forgotten, so Retry starts again. -
Each module's
install()receives a component registry scoped to the keys its manifest
declares. Registering any other key is refused and logged. A key two modules declare belongs to
neither, and the view that needs it fails with an error. Component registry lookups are reactive. -
The analysis results page starts loading the analysis class's module frontend alongside the
index document, shows Loading analysis view… until the component is registered, and on a
failure shows an error with Retry. -
dt-ws reads module frontends once, when it loads or reloads a module, and holds the bytes,
their sha256 and gzip and brotli copies in memory. Files are opened without following symlinks
and capped at 64 KiB (manifest) and 32 MiB (bundle). -
@dethernety/dt-moduleis 0.13.0, and every API change in it is additive. The new parts are
the frontend-manifest helpers and subpaths, the engine probe, the schema and write-lock helpers,
and the./test-databaseand./cypher-lintdev/test subpaths (see Added). The one change in
behaviour is the knowledge-graph read order (see Fixed). A module that uses the new helpers
needs platform 0.13.0 and should declare"compatibility": { "dtModule": "^0.13.0" }in
manifest.json. For a 0.x version a caret range pins the minor version, so
scripts/package-module.jsrefuses a manifest that still declares^0.12.0against dt-module
0.13.0, and produces no package.dethernety-general,dethernety-coverage-toolsand
dethernety-threat-reportdeclare^0.13.0.
Removed
- Two unused dt-core GraphQL documents:
SUBSCRIBE_ANALYSIS_CHATandGET_DUMP_MODEL_DATA.
Both queried fields the schema does not have, and nothing used them. - Breaking: the
getAvailableFrontendModulesandgetModuleFrontendBundlequeries. Use
getFrontendModuleManifestand the bundle route. dt-core'sDtModule.getAvailableFrontendModules()
andDtModule.getModuleFrontendBundle(), and theGET_AVAILABLE_FRONTEND_MODULESand
GET_MODULE_FRONTEND_BUNDLEdocuments, are removed with them.
Fixed
- Statements Neo4j refused now run on both engines. Neo4j 5 refuses an aggregating column that
reads a variable its clause does not also project as a key; Memgraph runs it. Model deletion
(deleteModel's analysis lookup),controlGaps,getControlsAssignedModelsand the threat
report's ledger had that shape and failed on Neo4j. Each now collects in oneWITHand adds the
lists in the next, with the same rows on both engines. - Concurrent finding writes for one element no longer duplicate a finding or a binding. Within
one platform process these writes were already serialised per element; across processes, two
writers could both find a finding absent and create it twice, or both rewire the same class
binding. The exposure and countermeasure upserts and the class rebind now take the element's
database lock (writeLockClause) before they read. On Neo4j the second writer waits and reads
what the first committed; on Memgraph it conflicts and its write transaction is retried. - A threat report snapshot write retries a conflict. Two runs of one analysis write the report
snapshot to the same Analysis node. On Memgraph the second met a transient conflict and failed,
because it ran as an auto-commit. It now runs in a write transaction: the conflict is retried and
the last run to commit wins. A missing Analysis node still fails loudly. - Knowledge-graph answers are the same on both engines. Each engine returned a rule's reads
(KgRule.reads) and a threat's sources (KgThreat.derivedFrom) in an order of its own.
dt-module's knowledge-graph normalisation now orders reads by name and sources by id, in
code-unit order, so the local and remote clients answer alike on either engine. - The control dialog no longer saves a list with an empty row. Clearing a row of a list in the
control dialog's attribute form left a hole that reached the server as null, which the server now
refuses. The dialog drops emptied entries from every list before it saves, so a list stored
earlier with a null heals on its next save. An empty string stays: it is a value. byodt versionlistsNEO4J_IMAGE. Its pattern for the image lines in.envmissed a name
with a digit in it, so a Neo4j deployment'sversiondid not show the image it runs.- On Neo4j a bootstrap index could go missing until the next restart. dt-ws ran its index
bootstrap and its constraint bootstrap side by side, and on Neo4j an index and a uniqueness
constraint on the same label (:Module(id)and:Module(name)) could deadlock; the index lost
that way stayed missing, and the lookups it serves scanned the label. The index bootstrap now
starts once the constraint bootstrap has finished, on either engine. - On Neo4j, GraphQL queries that select a DateTime field no longer fail. The GraphQL layer reads
every DateTime field throughapoc.date.convertFormatand writesapoc.util.validatePredicateinto
the checks of some mutations, and the bundle's Neo4j loaded no APOC, so such a query failed with
Unknown function 'apoc.date.convertFormat'.compose.neo4j.yamlnow sets
NEO4J_server_directories_pluginsto/var/lib/neo4j/labs, where the image ships the APOC Core
jar, andNEO4J_dbms_security_procedures_allowlistto the two functions. Only those two load: no
other APOC procedure or function can be called, none is granted unrestricted access, and nothing is
copied, written or downloaded. At startup on Neo4j, dt-ws now lists both functions and, when both
are listed, calls each once. It logs one error naming the missing functions, or saying they are
listed but cannot run, and starts either way. A Neo4j you run yourself needs APOC Core loaded and
both functions indbms.security.procedures.allowlist(see the configuration guide, Database
(Bolt/Cypher)). - Bootstrap schema statements run again after a transient error. The new
DatabaseService.executeSchemaWriteruns a schema statement as an auto-commit write and, when the
engine answers with a transient code (Neo.TransientError.*orMemgraph.TransientError.*),
runs it again: three attempts in all, pausing 200 ms and then 400 ms. Each retry logs a warning;
only the last failure is logged as an error and thrown. Every schema statement of the index,
constraint and old vector-index bootstrap goes through it. Any other error, including a lost
connection or a database that cannot be reached, fails at once.executeImplicitWriteis
unchanged: one attempt, no retry. - On Neo4j, opening a model no longer hangs. Opening a model runs dt-core's
findAnalyses,
which filtered the analysed element withsingle.elementpoints at theElementinterface,
and on Neo4j@neo4j/graphqlrenderssinglethere as a XOR of one predicate per member type;
withElement's 28 member types, Neo4j ran out of heap while it was still planning the query, and
the database answered nothing until it was restarted.findAnalysesnow filters withsome.
Element ids are unique, so it finds the same analyses, on either engine. - dt-core's issue search by element or by module works.
findIssuesfiltered the model link
and the module with fields the schema does not have (model,module), so a search by element
or by module failed. It now filters the model link withmodels, and the module through the
issue class, since an issue has no module link of its own. - dt-core's analyses lookup by module works.
findAnalysesfiltered the module with amodule
field the schema does not have, so a lookup by module failed. It now filters the module through
the analysis class. - Dethereal's control-class suggestion works. When a control's
class_idsnames a class that is
not a CONTROL class, the error lists the CONTROL classes of the same module. The lookup behind it
filtered the module by a bare id instead of{ eq: <id> }, so it failed and the error came
without the list.
Security
-
One GraphQL request could exhaust a Neo4j database's memory, or stall dt-ws on either engine;
dt-ws now refuses it. Asinglefilter on a relationship to an interface or union type renders
on Neo4j as a XOR of one predicate per member type, and Neo4j's planner rewrites a XOR chain into
a form that grows exponentially with its length. On a relationship toElement, one such request
exhausted the database's heap while the query was still being planned, and the database answered
nothing until a restart. With authentication off, anyone who could reach the API could send it;
with authentication on, any signed-in user could. Every GraphQL transport now refuses, per
request, anysinglefilter, or deprecated<field>_SINGLE/<field>Connection_SINGLEfield,
on a relationship to an interface or union, with an error that names the filter's path and says to
usesome.some,allandnonerender as one predicate per member type joined by OR or AND,
which grows linearly, and stay allowed, within new limits on what a request can make dt-ws
translate and the database plan:- a filter budget of 300: each relationship or connection filter quantifier (
some,all,
none, and their deprecated_SOME… forms) costs the number of types it can match (28 on
Element, 1 on a concrete type), andallcosts twice that; an aggregate filter costs what a
someon the same relationship does; a filter on a@cypherfield costs 2, or 10 when the
field's statement walks a variable-length path; a condition on a stored property,inlists
included, costs nothing. The largest any platform client sends is 58; - at most 2,500 input objects in all of a request's arguments, and 1,000 in its
where
arguments. A platform client's request grows only with links that carry a justification (a
countermeasure create reaches 2,500 at 495 technique links), and sends at most 42 inwhere; - at most 640 relationship operands in a request's mutation inputs: each item of a connect,
disconnect, create, update or delete under a relationship counts once per type its target can be
(28 onElement). A platform client's operands grow only with the same justified links; - at most 4,000,000 characters of scalar values: a string counts its length, any other scalar
one, a list or JSON value its entries summed; - input nested at most 64 levels deep;
- at most 10,000 selections once fragments are expanded.
dt-ws translates GraphQL into Cypher on its event loop, which is single-threaded, on either
engine, and the statement grows with the request's arguments: one mutation with 24,000
relationship operands held the event loop for 58 seconds, and dt-ws answered no other request
meanwhile. This affects released versions on both engines; the input-object, operand and
scalar-size limits bound what one request makes dt-ws translate. dt-core sends a link write that
carries nothing but its target (assignControlToElements, an element's controls and data items, a
model's modules and controls, the technique-link updates of exposures and countermeasures) as one
operand per relationship with the ids in aninlist, so the write stays the same size however
long the list is.The limits count an input as often as
@neo4j/graphqlrenders it: everything under a filter or an
operand on an interface or union counts once per member type (28 times onElement), and under
alltwice that; a value counts once for every place it is used, as the library writes a value
into a Cypher parameter of its own each time a variable is referenced, so one large list
referenced from hundreds of places counts hundreds of times. A fragment counts once for every
place it is spread, the filters are checked whether they are written in the query or sent in its
variables, and a variable's default value is checked as execution applies it.On
/graphqla refusal is a GraphQL error with codeBAD_USER_INPUTand HTTP status 400, and so
is a complexity-limit refusal, which was an internal error with HTTP status 500; on the
/graphql/streamSSE endpoint it is a 400 whose error names the refusal; on the WebSocket
transport it is GraphQL errors, sent with nothing run. In production/graphqlreplaces the
message with "Internal server error", as for every error, and keeps theBAD_USER_INPUTcode. The
checks run on both engines. Neo4j support is new in this release, so no earlier release is affected
by the Neo4j failure. API callers: a query that usedsingleon such a relationship is now refused
on Memgraph too; usesome(a filter on a uniqueidmatches the same nodes). - a filter budget of 300: each relationship or connection filter quantifier (
-
The WebSocket transport runs the query guards. With
SUBSCRIPTION_TRANSPORT=ws, the opt-in
graphql-ws transport carries queries and mutations as well as subscriptions, and it ran none of
the query guards: no depth limit, no complexity limit. It now runs the depth rules, the
relationship-filter limits and the complexity limit for every operation, as/graphqland
/graphql/streamdo, and answers a refusal with GraphQL errors without running anything. This
affects released versions on a deployment that setSUBSCRIPTION_TRANSPORT=ws; the default,
sse, is unchanged. -
Deeply nested fragment spreads could stall request validation. The query-depth rule came from
thegraphql-depth-limitpackage, which re-measured a fragment at every place it was spread, so a
small document of fragments that spread one another took exponential time to validate, and any
client could send one. dt-ws now enforces the depth limit with its own rule, which measures each
fragment once. The limit (GQL_QUERY_DEPTH_LIMIT, default 10), the way depth is counted and the
refusal text are unchanged, and thegraphql-depth-limitdependency is removed. This affects
released versions. -
Request guards are stricter and ordered the same on every transport. The relationship-filter
check refuses, withBAD_USER_INPUTand HTTP status 400, a value that is not an object where an
input object is expected and a field the input type does not define, as variable coercion does; a
null entry in a list of input objects counts as one input object. The check reads only the
operation the request runs, selected byoperationNameas execution selects it, with only the
variables that operation declares; a request that selects no single operation, because it holds
several operations and nooperationNameor because no operation has theoperationNameit
names, is refused withBAD_USER_INPUTand HTTP status 400./graphql/streamvalidates the
operation before the per-request guards run, as/graphqland the WebSocket transport do. -
The bundle route's authentication is
JwtAuthGuard(a valid JWT, thenDEPLOYMENT_ALLOWLIST),
then the module allow-list (ALLOWED_MODULES). Without OIDC and withNODE_ENVother than
production, the guard's development bypass leaves the route open, as it leaves every guarded route. -
The bearer token stays on the API origin. dt-ui fetches a bundle only from the API server's
origin under/module-bundles/, and refuses redirects. -
Bundle integrity. dt-ui checks the bytes against the manifest's sha256 where
crypto.subtle
exists. It does not exist over plain HTTP on a host other thanlocalhostor a loopback address,
and there the check is skipped. -
Caching limits. The
private, immutable cache is per browser profile: fine while bundles are
deployment-wide, but it would bypass any future per-user authorization of bundles. Logout or
revocation does not purge cached bundles, and a cached URL is served without a token. A CDN or
reverse proxy in front of dt-ws must honourprivateand must not cache by path. -
blob:stays inscript-src. The bundle is fetched with the bearer token and imported from a
blob URL. Droppingblob:needs a same-origin bundle route that does not use a bearer token. -
Module frontends remain trusted code with full page privilege; the scoped registry prevents
accidental key collisions and is not isolation. Seedocs/SECURITY_MODEL.md, Module frontends.
Documentation
- The frontend module system, the frontend architecture's loading flow and host dependencies, the
DTModule interface (a Module frontend section), the module package design, the threat report's
frontend, the security model, and the GraphQL, schema, dt-core and module registry references
describe manifest-based, on-demand loading.