Skip to content

Conversation

@Adarsh2692
Copy link
Contributor

No description provided.

@gitguardian
Copy link

gitguardian bot commented Jan 2, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
24068148 Triggered Generic High Entropy Secret e4683cb src/channelHandlers/browserstack-api.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

return new Promise((resolve) => {
const { exec } = require('child_process');

exec(`ps -o pid= -g ${pgid}`, (error: any, stdout: string) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument pgid. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.
const { exec } = require('child_process');

// Look for common browser processes in the process group
exec(`ps -o pid=,comm= -g ${pgid}`, (error: any, stdout: string) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument pgid. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.
// Check if main process is still running
const { exec } = require('child_process');

exec(`kill -0 ${session.mainProcess.pid}`, (error: any) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument sessionId. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.
Comment on lines +436 to +445
const child = spawn(command, {
shell: true,
env: {
...process.env,
PERCY_TOKEN: PERCY_TOKEN,
BSTACK_LOCAL_KEY: BSTACK_LOCAL_KEY
},
detached: true, // Create new process group
stdio: ['ignore', 'pipe', 'pipe']
});

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.audit.spawn-shell-true.spawn-shell-true Error

Found '$SPAWN' with '{shell: true}'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use '{shell: false}' instead.
const optionsString = commandOptions.length > 0 ? ` ${commandOptions.join(' ')}` : '';
const command = `npx percy support:debug "${snapshotUrl}"${optionsString}`;

const child = spawn(command, {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument snapshotUrl. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.
console.log('Graceful termination failed, using forceful termination');

// Force kill the entire process group
exec(`kill -KILL -${session.processGroupId}`, (error2: any) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument processId. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.

// Kill main process
killPromises.push(new Promise((killResolve) => {
exec(`kill -KILL ${session.mainProcess.pid}`, (killError: any) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument processId. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.
// Kill all child processes
session.childProcesses.forEach(childPid => {
killPromises.push(new Promise((killResolve) => {
exec(`kill -KILL ${childPid}`, (killError: any) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument childPid. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.

// Wait a moment and check if processes are still running
setTimeout(() => {
exec(`kill -0 -${session.processGroupId}`, (checkError: any) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument processId. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.
});
} else {
// Still running, force kill
exec(`kill -KILL -${session.processGroupId}`, (forceError: any) => {

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: javascript.lang.security.detect-child-process.detect-child-process Error

Detected calls to child_process from a function argument processId. This could lead to a command injection if the input is user controllable. Try to avoid calls to child_process, and if it is needed ensure user input is correctly sanitized or sandboxed.
@Adarsh2692 Adarsh2692 closed this Jan 2, 2026
@Adarsh2692 Adarsh2692 deleted the percy_snapshot_replay branch January 2, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants