Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .nsprc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"notes": "CVE-2026-118764: at optimizationLevel >= 2, minimatch's firstPhasePreProcess() splits every `**/..` portion of a pattern inside a fixpoint loop and secondPhasePreProcess() then compares every pair, so a short crafted pattern (14 repetitions of `**/../a/b` take about 4 s) exhausts CPU. Only the pattern triggers it, never the matched path, and only at optimizationLevel 2, which glob 9+ sets and minimatch's default (1) does not. Accepted risk: the fix exists only in minimatch 11.0.1+ (3.x, 5.x, 9.x and 10.x have no backport), no dependent in this tree except glob 14 admits 11, and 11.0 is a rewrite (no default export, makeRe and matchOne removed) that an override cannot force without breaking glob 7 and 10 matching, test-exclude 6 and eslint-plugin-import (they call minimatch as a function) and the default import in src/platform/interpreter/reservedNamedProvider.node.ts. The shipped copies do not contain the vulnerable preprocessing and are flagged by version range only: 3.1.5 (hoisted; bundled through reservedNamedProvider.node.ts's direct import, and prod-optional via @deepnote/sql-language-server -> sqlite3 -> node-gyp/cacache -> glob 7, install-time tooling) and 5.1.9 (vscode-languageclient 9.0.1). The shipped glob 14.0.3 runs its own inlined, fixed minimatch. The copies that contain the vulnerable code are dev-only and receive patterns only from this repository's own configuration: 9.0.9 under mocha 11.8.0 and rimraf 5.0.10 (via glob 10), and 10.2.5/10.2.6 under @vscode/vsce, @vscode/test-cli, c8, vscode-extension-tester and @actions/glob; in src/test/vscode-notebook-perf (mirrored in its osv-scanner.toml), 10.2.6 (hoisted) and 9.0.9 under @vscode/test-cli's mocha. The latest vscode-languageclient 11.0.0, mocha 12.0.3, @vscode/vsce 4.1.0, @vscode/test-cli 0.0.15 and test-exclude 8.0.0 still declare minimatch ^10, and eslint-plugin-import 2.32.0 declares ^3.1.2. Revisit at expiry for backports or dependents that admit minimatch >=11.0.1.",
"expiry": "2026-11-15"
},
"GHSA-mrhx-c7xc-m3w5": {
"notes": "CVE-2023-54404: zod builds one issue per invalid element while validating an oversized collection, so a huge input can exhaust memory (denial of service). Accepted risk: no patched zod 3.x release exists (range <4.6.6), and every @deepnote/* dependency pins zod to exactly 3.25.76, so a lockfile bump cannot reach a fix and an override would force an untested major under them. The shipped bundles use this zod to validate local .deepnote project files before notebook execution, including in limited-support untrusted workspaces. A crafted file that the user opens can stall or exhaust the extension host or CLI, with no data exposure. The 4.6.6 fix also only short-circuits collections with a .max()/.length()/.size() bound, so moving to zod 4 alone would clear the scanner without changing this behavior.",
"expiry": "2026-11-10"
},
"GHSA-xcx6-jx8p-x3h5": {
"notes": "CVE-2026-109461: @azure/msal-node's authorization code flow (acquireTokenByCode) may disclose request parameters to an attacker-controlled endpoint. Accepted risk: dev-only and not shipped (`npm ls @azure/msal-node --omit=dev` is empty; node_modules/** is excluded from the VSIX). One copy, @azure/msal-node@6.0.1, reached via @vscode/vsce (root and under vscode-extension-tester) -> @azure/identity@4.14.0. vsce uses @azure/identity only for `vsce publish` / `verify-pat --azure-credential`, through a chain of environment, Azure CLI and managed-identity credentials that never runs the authorization code flow; this repository only runs `vsce package`. The fix exists only on the 7.x line (first patched 7.1.0; 6.x has no backport), and the latest @azure/identity (4.14.0) still declares @azure/msal-node ^6.0.0, so a lockfile bump cannot reach it. Remove this entry and its osv-scanner.toml mirror once an @azure/identity release admits msal-node >=7.1.0.",
"expiry": "2026-11-10"
Expand Down
5 changes: 0 additions & 5 deletions osv-scanner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ id = "GHSA-g3hv-75wg-m249"
ignoreUntil = 2026-11-15
reason = "CVE-2026-118764 (minimatch): crafted-pattern DoS; shipped copies lack the code, dev copies get repo patterns only; fix only in 11.x. See .nsprc."

[[IgnoredVulns]]
id = "GHSA-mrhx-c7xc-m3w5"
ignoreUntil = 2026-11-10
reason = "CVE-2023-54404 (zod): local DoS only, via user-opened project files; no patched 3.x release. See .nsprc."

[[IgnoredVulns]]
id = "GHSA-xcx6-jx8p-x3h5"
ignoreUntil = 2026-11-10
Expand Down
643 changes: 76 additions & 567 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2735,13 +2735,13 @@
},
"dependencies": {
"@c4312/evt": "^0.1.1",
"@deepnote/blocks": "^4.8.1",
"@deepnote/cli": "0.8.0",
"@deepnote/cloud": "0.2.1",
"@deepnote/cloud-sync": "0.1.0",
"@deepnote/convert": "^4.0.3",
"@deepnote/database-integrations": "^1.7.1",
"@deepnote/runtime-core": "^0.7.0",
"@deepnote/blocks": "^5.0.0",
"@deepnote/cli": "0.11.0",
"@deepnote/cloud": "0.3.0",
"@deepnote/cloud-sync": "0.2.0",
"@deepnote/convert": "^5.0.0",
"@deepnote/database-integrations": "^2.0.0",
"@deepnote/runtime-core": "^0.8.0",
"@deepnote/sql-language-server": "^3.0.1",
"@enonic/fnv-plus": "^1.3.0",
"@jupyter-widgets/base": "^6.0.8",
Expand Down Expand Up @@ -2819,7 +2819,6 @@
"tailwind-merge": "^3.3.1",
"tcp-port-used": "^1.0.1",
"tmp": "^0.2.7",
"ts-dedent": "^2.2.0",
"url-parse": "^1.5.10",
"uuid": "^13.0.2",
"vega": "^6.2.0",
Expand Down Expand Up @@ -3014,7 +3013,7 @@
"bn.js@<4.12.3": "4.12.3",
"serialize-javascript@<7.1.3": "7.1.3",
"flatted@<3.4.2": "3.4.2",
"yaml": "2.8.3",
"yaml": "2.9.1",
"ip-address": "10.7.4",
"mermaid": "11.16.1",
"postcss": "$postcss",
Expand Down
2 changes: 1 addition & 1 deletion specs/INTEGRATIONS_CREDENTIALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The integrations system enables Deepnote notebooks to connect to external data s

### External Dependencies

#### **@deepnote/database-integrations Package** (v1.1.0)
#### **@deepnote/database-integrations Package**

The system uses the `@deepnote/database-integrations` package as the source of truth for:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DeepnoteBlock } from '@deepnote/blocks';
import { createPythonCodeForSqlBlockWithConnectionJson, type DeepnoteBlock } from '@deepnote/blocks';
import { BigQueryAuthMethods } from '@deepnote/database-integrations';
import { inject, injectable } from 'inversify';
import { Uri } from 'vscode';
Expand All @@ -11,13 +11,6 @@ import {
computeMetadataFingerprint
} from './federatedAuthTokenStorage.node';
import { GOOGLE_TOKEN_URL } from './googleOAuthProvider.node';
import {
createDataFrameConfig,
executeSqlQueryWithConnectionJson,
sanitizePythonVariableName,
SqlCacheMode,
SqlCellVariableType
} from './vendoredBlocksHelpers';
import {
FederatedAuthTokenEntry,
IFederatedAuthSqlBlockCodeGenerator,
Expand Down Expand Up @@ -117,24 +110,6 @@ export class FederatedAuthSqlBlockCodeGenerator implements IFederatedAuthSqlBloc
param_style: 'pyformat'
});

// Mirror upstream `createPythonCodeForSqlBlock`'s metadata reads.
const query = sqlBlock.content ?? '';
const rawVariableName = sqlBlock.metadata?.deepnote_variable_name;
const pythonVariableName =
rawVariableName !== undefined ? (sanitizePythonVariableName(rawVariableName) ?? 'input_1') : undefined;
const returnVariableType: SqlCellVariableType = sqlBlock.metadata?.deepnote_return_variable_type ?? 'dataframe';
const sqlCacheMode: SqlCacheMode = 'cache_disabled';

const dataFrameConfig = createDataFrameConfig(sqlBlock);
const executeSqlCall = executeSqlQueryWithConnectionJson({
query,
auditComment: '',
connectionJson,
pythonVariableName,
sqlCacheMode,
returnVariableType
});

return `${dataFrameConfig}\n\n${executeSqlCall}`;
return createPythonCodeForSqlBlockWithConnectionJson(sqlBlock, { connectionJson });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,14 @@ suite('FederatedAuthSqlBlockCodeGenerator', () => {
// Match upstream's shape: `my_df = _dntk.execute_sql_with_connection_json(...)` followed by `my_df` on the next line.
assert.include(result, 'my_df = _dntk.execute_sql_with_connection_json(');
});

test('escapes the carriage return of a CRLF query so the query stays one Python string literal', async () => {
setupValidFederatedIntegration();
const result = await generator.generate(buildSqlBlock({ content: 'SELECT 1\r\nFROM t' }), NOTEBOOK_URI);
if (typeof result !== 'string') {
throw new Error(`expected a string result, got ${typeof result}`);
}

assert.include(result, "'SELECT 1\\r\\nFROM t'");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function settleAsyncHandlers(ms = DEFAULT_SETTLE_DELAY_MS): Promise<void>
return new Promise((resolve) => setTimeout(resolve, ms));
}

/** Inverse of `escapePythonString`: parses a Python single-quoted literal back to its source string. */
/** Parses a Python single-quoted literal, decoding only `\\`, `\'` and `\n`; other escapes are kept verbatim. */
export function parsePythonSingleQuoted(escaped: string): string {
if (!escaped.startsWith("'") || !escaped.endsWith("'")) {
throw new Error('must be wrapped in single quotes');
Expand Down

This file was deleted.

This file was deleted.

Loading