Skip to content

Commit 7e97190

Browse files
Merge pull request #4 from squaredup/INT-001-Code-alerts
INT-001-Code-Alert update
2 parents 9367c2f + 3de41f7 commit 7e97190

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/Config/config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// This is a fake AWS Access Key and Secret Key for testing Secret Scanning.
2-
// GitHub will identify the pattern and flag it as a "Critical" alert.
3-
const AWS_ACCESS_KEY_ID = "AKIA1234567890EXAMPLE";
4-
const AWS_SECRET_ACCESS_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY";
1+
// AWS Access Key and Secret Key for testing Secret Scanning.
2+
const AWS_ACCESS_KEY_ID = "AKIA12345678907890";
3+
const AWS_SECRET_ACCESS_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYRGR444";

src/utils/child_process.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import { exec } from 'child_process';
22

3-
/**
4-
* This function is intentionally vulnerable to Command Injection.
5-
* CodeQL (GitHub Code Scanning) should flag the use of `exec`
6-
* with a variable that could contain malicious commands.
3+
/* CodeQL (GitHub Code Scanning) should flag the use of `exec` with untrusted input as a "Critical" alert for Command Injection.
74
*/
85
export function runUserCommand(userInput: string) {
9-
// Vulnerability: `userInput` is passed directly to the shell.
10-
// An attacker could provide "ls; rm -rf /" to execute arbitrary commands.
116
exec(`echo ${userInput}`, (error, stdout, stderr) => {
127
if (error) {
138
console.error(`Error: ${error.message}`);

0 commit comments

Comments
 (0)