Sanitize the hardcoded Stripe test key (avoid tripping secret scanners)
Browse files- golden.jsonl +1 -1
golden.jsonl
CHANGED
|
@@ -113,6 +113,6 @@
|
|
| 113 |
{"id": "python_ssrf_fixed_host_safe", "label": "safe", "stack": "fastapi", "group": "synthetic-v1", "path": "app/client.py", "categories": [], "cwe": [], "code": "import requests\n\n# Host FIXE (api.stripe.com), l'entrée n'est qu'un segment de chemin -> pas SSRF.\n@app.get(\"/charge/{cid}\")\nasync def charge(cid: str):\n return requests.get(f\"https://api.stripe.com/v1/charges/{cid}\").json()"}
|
| 114 |
{"id": "python_yaml_safe_load_safe", "label": "safe", "stack": "fastapi", "group": "synthetic-v1", "path": "app/config.py", "categories": [], "cwe": [], "code": "import yaml\n\n# yaml.safe_load n'exécute pas de code -> sûr -> aucun finding attendu.\ndef load_config(body):\n return yaml.safe_load(body)"}
|
| 115 |
{"id": "secret_env_safe", "label": "safe", "stack": "nextjs", "group": "synthetic-v1", "path": "lib/stripe.ts", "categories": [], "cwe": [], "code": "import Stripe from \"stripe\";\nexport const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);"}
|
| 116 |
-
{"id": "secret_stripe_hardcoded", "label": "vulnerable", "stack": "nextjs", "group": "synthetic-v1", "path": "lib/stripe.ts", "categories": ["hardcoded_secret"], "cwe": ["CWE-798"], "code": "import Stripe from \"stripe\";\nexport const stripe = new Stripe(\"
|
| 117 |
{"id": "typeorm_additive_safe", "label": "safe", "stack": "express", "group": "synthetic-v1", "path": "src/migrations/1700000001000-AddUserBio.ts", "categories": [], "cwe": [], "code": "import { MigrationInterface, QueryRunner } from \"typeorm\";\n\nexport class AddUserBio1700000001000 implements MigrationInterface {\n public async up(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`ALTER TABLE \"users\" ADD \"bio\" text`);\n }\n\n // Le rollback DROP la colonne ajoutée : c'est la réversion attendue,\n // pas une migration destructrice -> ne doit PAS être flagué.\n public async down(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`ALTER TABLE \"users\" DROP COLUMN \"bio\"`);\n }\n}"}
|
| 118 |
{"id": "typeorm_drop_table", "label": "vulnerable", "stack": "express", "group": "synthetic-v1", "path": "src/migrations/1700000000000-DropLegacyUsers.ts", "categories": ["destructive_migration"], "cwe": [], "code": "import { MigrationInterface, QueryRunner } from \"typeorm\";\n\nexport class DropLegacyUsers1700000000000 implements MigrationInterface {\n public async up(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`DROP TABLE \"users\"`);\n }\n\n public async down(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`CREATE TABLE \"users\" (id SERIAL PRIMARY KEY)`);\n }\n}"}
|
|
|
|
| 113 |
{"id": "python_ssrf_fixed_host_safe", "label": "safe", "stack": "fastapi", "group": "synthetic-v1", "path": "app/client.py", "categories": [], "cwe": [], "code": "import requests\n\n# Host FIXE (api.stripe.com), l'entrée n'est qu'un segment de chemin -> pas SSRF.\n@app.get(\"/charge/{cid}\")\nasync def charge(cid: str):\n return requests.get(f\"https://api.stripe.com/v1/charges/{cid}\").json()"}
|
| 114 |
{"id": "python_yaml_safe_load_safe", "label": "safe", "stack": "fastapi", "group": "synthetic-v1", "path": "app/config.py", "categories": [], "cwe": [], "code": "import yaml\n\n# yaml.safe_load n'exécute pas de code -> sûr -> aucun finding attendu.\ndef load_config(body):\n return yaml.safe_load(body)"}
|
| 115 |
{"id": "secret_env_safe", "label": "safe", "stack": "nextjs", "group": "synthetic-v1", "path": "lib/stripe.ts", "categories": [], "cwe": [], "code": "import Stripe from \"stripe\";\nexport const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);"}
|
| 116 |
+
{"id": "secret_stripe_hardcoded", "label": "vulnerable", "stack": "nextjs", "group": "synthetic-v1", "path": "lib/stripe.ts", "categories": ["hardcoded_secret"], "cwe": ["CWE-798"], "code": "import Stripe from \"stripe\";\nexport const stripe = new Stripe(\"sk_live_EXAMPLE0NOTAREALKEY\");"}
|
| 117 |
{"id": "typeorm_additive_safe", "label": "safe", "stack": "express", "group": "synthetic-v1", "path": "src/migrations/1700000001000-AddUserBio.ts", "categories": [], "cwe": [], "code": "import { MigrationInterface, QueryRunner } from \"typeorm\";\n\nexport class AddUserBio1700000001000 implements MigrationInterface {\n public async up(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`ALTER TABLE \"users\" ADD \"bio\" text`);\n }\n\n // Le rollback DROP la colonne ajoutée : c'est la réversion attendue,\n // pas une migration destructrice -> ne doit PAS être flagué.\n public async down(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`ALTER TABLE \"users\" DROP COLUMN \"bio\"`);\n }\n}"}
|
| 118 |
{"id": "typeorm_drop_table", "label": "vulnerable", "stack": "express", "group": "synthetic-v1", "path": "src/migrations/1700000000000-DropLegacyUsers.ts", "categories": ["destructive_migration"], "cwe": [], "code": "import { MigrationInterface, QueryRunner } from \"typeorm\";\n\nexport class DropLegacyUsers1700000000000 implements MigrationInterface {\n public async up(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`DROP TABLE \"users\"`);\n }\n\n public async down(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`CREATE TABLE \"users\" (id SERIAL PRIMARY KEY)`);\n }\n}"}
|