Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive deprecated api usage warning for security or usability about Buffer() #7851

Open
PegasusPlusUS opened this issue Dec 5, 2024 · 1 comment
Labels
Milestone

Comments

@PegasusPlusUS
Copy link

Environment data

dotnet --info output:
$ dotnet --info
.NET SDK:
Version: 9.0.100
Commit: 59db016f11
Workload version: 9.0.100-manifests.c6f19616
MSBuild version: 17.12.7+5b8665660

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100\

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.0
Architecture: x64
Commit: 9d5a6a9aa4

.NET SDKs installed:
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

VS Code version:
1.95.3
C# Extension version:
1.13.9

Steps to reproduce

VSCode run debug extension, with C# Dev Kit, there's warning message in debug console:
DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
at showFlaggedDeprecation (node:buffer:189:11)
at new Buffer (node:buffer:267:3)
at s (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:891803)
at 52847 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:891774)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 48204 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:894013)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 10816 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:897497)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 50897 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:906200)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 73357 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:896258)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 47870 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:897033)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 15637 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:889919)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 95539 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:155936)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 67208 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:143952)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 4084 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:178818)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 24984 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:1191902)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 25453 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:1540270)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 78734 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:1140434)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 87947 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:1166752)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at 87927 (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:1208465)
at n (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2415616)
at c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2416056
at Object. (c:\Users\pegas.vscode\extensions\ms-dotnettools.csharp-2.55.29-win32-x64\dist\extension.js:2:2416083)
at Module._compile (node:internal/modules/cjs/loader:1484:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
at Module.load (node:internal/modules/cjs/loader:1295:32)
at Module._load (node:internal/modules/cjs/loader:1111:12)
at c._load (node:electron/js2c/node_init:2:16955)
at e._load (file:///c:/Users/pegas/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:174:10900)
at t._load (file:///c:/Users/pegas/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:166:22433)
at i.load (file:///c:/Users/pegas/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:158:4651)
at Module.require (node:internal/modules/cjs/loader:1318:19)
at require (node:internal/modules/helpers:179:18)
at z
.xb (file:///c:/Users/pegas/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:166:23753)
at async Promise.all (index 0)

@dibarbet
Copy link
Member

dibarbet commented Dec 6, 2024

warning appears to show up in the Debug console when you F5 the C# extension. From some combination of setting env vars "NODE_OPTIONs": "--trace-deprecation" and/or "NODE_ENV": "--trace-deprecation" in launch.json or adding process.throwDeprecation = true; to the top of my VSCode's extensionHostProcess.js file, I managed to get this stack (most likely it was manually adding to extensionHostProcess.js, I tried env vars for a while and couldn't get anything).

2024-12-05 19:13:08.846 [error] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
	at showFlaggedDeprecation (node:buffer:189:11)
	at new Buffer (node:buffer:267:3)
	at alloc (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:86911:10)
	at ./node_modules/msgpack-lite/lib/bufferish-buffer.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:86899:54)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/msgpack-lite/lib/bufferish.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:87123:37)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/msgpack-lite/lib/ext-buffer.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:87606:17)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/msgpack-lite/lib/write-core.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:88448:18)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/msgpack-lite/lib/encode-buffer.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:87465:15)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/msgpack-lite/lib/encode.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:87549:21)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/msgpack-lite/index.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:86658:18)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/@microsoft/servicehub-framework/js/src/ServiceJsonRpcDescriptor.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:22035:30)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/@microsoft/servicehub-framework/js/src/FrameworkServices.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:18944:36)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./node_modules/@microsoft/servicehub-framework/js/src/index.js (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:28397:14)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./src/lsptoolshost/services/brokeredServicesHosting.ts (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:111634:32)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./src/shared/dotnetConfigurationProvider.ts (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:129557:35)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./src/lsptoolshost/debugger.ts (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:109118:39)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./src/lsptoolshost/roslynLanguageServer.ts (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:110367:20)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at ./src/main.ts (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:112367:32)
	at __webpack_require__ (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175632:42)
	at c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175684:37
	at Object.<anonymous> (c:\Users\dabarbet\source\repos\vscode-csharp\dist\extension.js:175687:12)
	at Module._compile (node:internal/modules/cjs/loader:1484:14)
	at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
	at Module.load (node:internal/modules/cjs/loader:1295:32)
	at Module._load (node:internal/modules/cjs/loader:1111:12)
	at c._load (node:electron/js2c/node_init:2:16955)
	at e._load (file:///c:/Users/dabarbet/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:180:10900)
	at t._load (file:///c:/Users/dabarbet/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:172:22433)
	at i._load (file:///c:/Users/dabarbet/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:164:4651)
	at Module.require (node:internal/modules/cjs/loader:1318:19)
	at require (node:internal/modules/helpers:179:18)
	at z_.xb (file:///c:/Users/dabarbet/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:172:23753)
	at async Promise.all (index 0)

Looks like an issue in a dependency of servicehub-framework - kawanet/msgpack-lite#98 and nothing we can solve in the extension at the moment.

@dibarbet dibarbet added Bug and removed untriaged labels Dec 6, 2024
@dibarbet dibarbet added this to the Backlog milestone Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants