Skip to content

Commit

Permalink
squash!
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Dec 18, 2023
1 parent ca6ef9d commit 05238c5
Show file tree
Hide file tree
Showing 22 changed files with 1,142 additions and 1,120 deletions.
7 changes: 6 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
This project has adopted the
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
additional questions or comments.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
[![build status](https://travis-ci.org/Microsoft/vscode-node-debug.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-node-debug)
[![build status](https://ci.appveyor.com/api/projects/status/t74psolxi3k7bcjp/branch/master?svg=true)](https://ci.appveyor.com/project/weinand/vscode-node-debug)

This extension is bundled with Visual Studio Code and together with **Node Debug** forms the [Node.js](https://nodejs.org) debugging experience.
This extension is bundled with Visual Studio Code and together with **Node
Debug** forms the [Node.js](https://nodejs.org) debugging experience.

**Node debug (legacy)** is the debugger for Node.js versions < 8.0.

See a general overview of debugging in VS Code [here](https://code.visualstudio.com/docs/editor/debugging).
See a general overview of debugging in VS Code
[here](https://code.visualstudio.com/docs/editor/debugging).

Documentation for Node.js specific debugging can be found [here](https://code.visualstudio.com/docs/nodejs/nodejs-debugging).

Please submit bugs and feature requests to the [VS Code repository](https://github.com/microsoft/vscode/issues).
Documentation for Node.js specific debugging can be found
[here](https://code.visualstudio.com/docs/nodejs/nodejs-debugging).

Please submit bugs and feature requests to the
[VS Code repository](https://github.com/microsoft/vscode/issues).

## License

Expand Down
54 changes: 38 additions & 16 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,62 @@

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
Microsoft takes the security of our software products and services seriously,
which includes all source code repositories managed through our GitHub
organizations, which include [Microsoft](https://github.com/Microsoft),
[Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet),
[AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and
[our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned
repository that meets
[Microsoft's definition of a security vulnerability](<https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)>),
please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
Instead, please report them to the Microsoft Security Response Center (MSRC) at
[https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
If you prefer to submit without logging in, send email to
[secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your
message with our PGP key; please download it from the
[Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
You should receive a response within 24 hours. If for some reason you do not,
please follow up via email to ensure we received your original message.
Additional information can be found at
[microsoft.com/msrc](https://www.microsoft.com/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
Please include the requested information listed below (as much as you can
provide) to help us better understand the nature and scope of the possible
issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting,
etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
If you are reporting for a bug bounty, more complete reports can contribute to a
higher bounty award. Please visit our
[Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more
details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
Microsoft follows the principle of
[Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
14 changes: 7 additions & 7 deletions Source/node/debugInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
return (
mirror.propertyNames(
PropertyKind.Named | PropertyKind.Indexed,
limit,
limit
).length >= limit
);
};
Expand Down Expand Up @@ -100,7 +100,7 @@
*/
try {
var JSONProtocolSerializer = vm.runInDebugContext(
"JSONProtocolSerializer",
"JSONProtocolSerializer"
);

JSONProtocolSerializer.prototype.serializeReferencedObjects =
Expand Down Expand Up @@ -136,7 +136,7 @@
*/
DebugCommandProcessor.prototype.dispatch_["vscode_slice"] = function (
request,
response,
response
) {
var handle = request.arguments.handle;
var start = request.arguments.start;
Expand All @@ -161,7 +161,7 @@
if (mirror.isArray()) {
var a = mirror.indexedPropertiesFromRange(
start,
start + count - 1,
start + count - 1
);
for (var i = 0; i < a.length; i++) {
result.push({
Expand Down Expand Up @@ -230,7 +230,7 @@
*/
DebugCommandProcessor.prototype.dispatch_["vscode_lookup"] = function (
request,
response,
response
) {
var result = this.lookupRequest_(request, response);
if (!result && response.body) {
Expand All @@ -249,7 +249,7 @@
*/
DebugCommandProcessor.prototype.dispatch_["vscode_evaluate"] = function (
request,
response,
response
) {
var result = this.evaluateRequest_(request, response);
if (!result) {
Expand All @@ -263,7 +263,7 @@
*/
DebugCommandProcessor.prototype.dispatch_["vscode_scopes"] = function (
request,
response,
response
) {
var result = this.scopesRequest_(request, response);
if (!result) {
Expand Down
30 changes: 15 additions & 15 deletions Source/node/extension/autoAttach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const pids: Promise<number>[] = [];
let autoAttacher: vscode.Disposable | undefined;

export function getPidFromSession(
session: vscode.DebugSession,
session: vscode.DebugSession
): Promise<number> {
return new Promise<number>((resolve, e) => {
setTimeout(
Expand All @@ -43,14 +43,14 @@ export function getPidFromSession(
(e) => {
clearTimeout(timer);
resolve(NaN);
},
}
);
} else {
clearTimeout(timer);
resolve(NaN);
}
},
session.type === "legacy-node2" ? 500 : 100,
session.type === "legacy-node2" ? 500 : 100
);
});
}
Expand All @@ -65,7 +65,7 @@ export function initializeAutoAttach(context: vscode.ExtensionContext) {
// try to get pid from newly started node.js debug session
pids.push(getPidFromSession(session));
}
}),
})
);

context.subscriptions.push(
Expand All @@ -82,15 +82,15 @@ export function initializeAutoAttach(context: vscode.ExtensionContext) {
const name = localize(
"process.with.pid.label",
"Auto attached ({0})",
pid,
pid
);
attachToProcess(undefined, name, pid, args);
}
},
}
);
}
},
),
}
)
);

context.subscriptions.push(
Expand All @@ -101,8 +101,8 @@ export function initializeAutoAttach(context: vscode.ExtensionContext) {
autoAttacher.dispose();
autoAttacher = undefined;
}
},
),
}
)
);
}

Expand All @@ -118,7 +118,7 @@ export function attachToProcess(
pid: number,
args: string,
baseConfig?: vscode.DebugConfiguration,
parentSession?: vscode.DebugSession,
parentSession?: vscode.DebugSession
) {
alreadyAttached(pid).then((isAttached) => {
if (isAttached) {
Expand Down Expand Up @@ -191,7 +191,7 @@ export function attachToProcess(
function pollProcesses(
rootPid: number,
inTerminal: boolean,
cb: (pid: number, cmd: string, args: string) => void,
cb: (pid: number, cmd: string, args: string) => void
): vscode.Disposable {
let stopped = false;

Expand All @@ -215,12 +215,12 @@ function pollProcesses(
function findChildProcesses(
rootPid: number,
inTerminal: boolean,
cb: (pid: number, cmd: string, args: string) => void,
cb: (pid: number, cmd: string, args: string) => void
): Promise<void> {
function walker(
node: ProcessTreeNode,
terminal: boolean,
terminalPids: (number | undefined)[],
terminalPids: (number | undefined)[]
) {
if (terminalPids.indexOf(node.pid) >= 0) {
terminal = true; // found the terminal shell
Expand All @@ -241,7 +241,7 @@ function findChildProcesses(
const terminals = vscode.window.terminals;
if (terminals.length > 0) {
Promise.all(
terminals.map((terminal) => terminal.processId),
terminals.map((terminal) => terminal.processId)
).then((terminalPids) => {
walker(tree, !inTerminal, terminalPids);
});
Expand Down
12 changes: 6 additions & 6 deletions Source/node/extension/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class Cluster {

public static prepareAutoAttachChildProcesses(
folder: vscode.WorkspaceFolder | undefined,
config: vscode.DebugConfiguration,
config: vscode.DebugConfiguration
) {
this.clusters.set(config.name, new Cluster(folder, config));
}
Expand All @@ -46,7 +46,7 @@ export class Cluster {

private constructor(
private _folder: vscode.WorkspaceFolder | undefined,
private _config: vscode.DebugConfiguration,
private _config: vscode.DebugConfiguration
) {
this._subProcesses = new Set<number>();
this._childCounter = 1;
Expand All @@ -63,15 +63,15 @@ export class Cluster {
const name = localize(
"child.process.with.pid.label",
"Child process {0}",
this._childCounter++,
this._childCounter++
);
attachToProcess(
this._folder,
name,
pid,
args,
this._config,
session,
session
);
}
});
Expand All @@ -92,7 +92,7 @@ export class Cluster {
function pollProcesses(
rootPid: number,
inTerminal: boolean,
cb: (pid: number, cmd: string, args: string) => void,
cb: (pid: number, cmd: string, args: string) => void
): vscode.Disposable {
let stopped = false;

Expand All @@ -115,7 +115,7 @@ function pollProcesses(

function findChildProcesses(
rootPid: number,
cb: (pid: number, cmd: string, args: string) => void,
cb: (pid: number, cmd: string, args: string) => void
): Promise<void> {
function walker(node: ProcessTreeNode) {
if (node.pid !== rootPid) {
Expand Down
Loading

0 comments on commit 05238c5

Please sign in to comment.