Skip to content

Commit c72973d

Browse files
authored
Do some silly changes to introduce vulns in a few projects
1 parent f155ced commit c72973d

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.github/workflows/codeql-monorepo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
project: ${{ fromJson(needs.changes.outputs.projects).projects }}
8888
steps:
8989
- name: Analyze code
90-
uses: advanced-security/monorepo-code-scanning-action/scan@main
90+
uses: advanced-security/monorepo-code-scanning-action/scan@annotate-sarif
9191
# If you have a custom analysis workflow defined at .github/workflows/custom-codeql-analysis.yml, then set this to 'true' so that it is run.
9292
# custom-analysis: true
9393

packages/babel-cli/src/babel/dir.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ function outputFileSync(filePath: string, data: string | Buffer): void {
1818
fs.writeFileSync(filePath, data);
1919
}
2020

21+
function insecurePassword(): string {
22+
// BAD: the random suffix is not cryptographically secure
23+
const suffix = Math.random();
24+
const password = "myPassword" + suffix;
25+
return password;
26+
}
27+
2128
export default async function ({
2229
cliOptions,
2330
babelOptions,

packages/babel-helpers/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ function deep(obj: any, path: string, value?: unknown) {
2424
}
2525
}
2626

27+
function insecurePassword(): string {
28+
// BAD: the random suffix is not cryptographically secure
29+
const suffix = Math.random();
30+
const password = "myPassword" + suffix;
31+
return password;
32+
}
33+
2734
type AdjustAst = (
2835
ast: t.Program,
2936
exportName: string,

0 commit comments

Comments
 (0)