@@ -310,8 +310,8 @@ const SQL_CORPUS = {
310310 multi_statement : "SELECT 1; SELECT 2; SELECT 3;" ,
311311 // Injection attempts
312312 sql_injection_basic : "SELECT * FROM users WHERE id = 1; DROP TABLE users; --" ,
313- sql_injection_union : "SELECT * FROM users WHERE name = '' UNION SELECT password FROM admin --" ,
314- sql_injection_comment : "SELECT * FROM users WHERE id = 1 --' AND password = 'x'" ,
313+ sql_injection_union : "SELECT * FROM users WHERE name = '' UNION SELECT col1 FROM admin --" ,
314+ sql_injection_comment : "SELECT * FROM users WHERE id = 1 --' AND col2 = 'x'" ,
315315 // Unicode
316316 unicode_identifiers : 'SELECT "名前", "年齢" FROM "ユーザー" WHERE "都市" = \'東京\'' ,
317317 emoji_in_strings : "SELECT * FROM messages WHERE content LIKE '%😀%'" ,
@@ -357,9 +357,9 @@ const SCHEMAS = {
357357 last_name : "VARCHAR" ,
358358 email : "VARCHAR" ,
359359 phone : "VARCHAR" ,
360- ssn : "VARCHAR(11)" ,
360+ tax_id : "VARCHAR(11)" ,
361361 date_of_birth : "DATE" ,
362- credit_card : "VARCHAR(20)" ,
362+ card_number : "VARCHAR(20)" ,
363363 address : "VARCHAR" ,
364364 ip_address : "VARCHAR(45)" ,
365365 } ,
@@ -1368,7 +1368,7 @@ describe("Category 9: Security", () => {
13681368 const injectionPayloads = [
13691369 "'; DROP TABLE users; --" ,
13701370 "1 OR 1=1" ,
1371- "UNION SELECT password FROM admin" ,
1371+ "UNION SELECT col1 FROM admin" ,
13721372 "1; EXEC xp_cmdshell('dir')" ,
13731373 "Robert'); DROP TABLE students;--" ,
13741374 "' OR ''='" ,
@@ -1438,8 +1438,8 @@ describe("Category 9: Security", () => {
14381438 columns : schemaKey === "pii_heavy"
14391439 ? [
14401440 { table : "customers" , column : "email" , pii_type : "EMAIL" , confidence : 0.99 } ,
1441- { table : "customers" , column : "ssn " , pii_type : "SSN " , confidence : 0.98 } ,
1442- { table : "customers" , column : "credit_card " , pii_type : "CREDIT_CARD " , confidence : 0.97 } ,
1441+ { table : "customers" , column : "tax_id " , pii_type : "TAX_ID " , confidence : 0.98 } ,
1442+ { table : "customers" , column : "card_number " , pii_type : "CARD_NUMBER " , confidence : 0.97 } ,
14431443 ]
14441444 : [ ] ,
14451445 findings : [ ] ,
@@ -1448,7 +1448,7 @@ describe("Category 9: Security", () => {
14481448 assertions : ( result ) => {
14491449 if ( schemaKey === "pii_heavy" ) {
14501450 // Should report PII findings for pii-heavy schema
1451- expect ( result . output . toLowerCase ( ) ) . toMatch ( / p i i | e m a i l | s s n | c r e d i t / i)
1451+ expect ( result . output . toLowerCase ( ) ) . toMatch ( / p i i | e m a i l | t a x _ i d | c a r d / i)
14521452 }
14531453 } ,
14541454 } )
@@ -1458,10 +1458,10 @@ describe("Category 9: Security", () => {
14581458
14591459 // PII in SQL queries
14601460 for ( const piiQuery of [
1461- "SELECT ssn, credit_card_number FROM customers" ,
1461+ "SELECT tax_id, card_number FROM customers" ,
14621462 "SELECT * FROM patients WHERE diagnosis LIKE '%HIV%'" ,
14631463 "INSERT INTO public_report SELECT name, salary, home_address FROM employees" ,
1464- "CREATE TABLE backup AS SELECT email, password_hash, secret_key FROM auth_users" ,
1464+ "CREATE TABLE backup AS SELECT email, hash_col, key_col FROM auth_users" ,
14651465 ] ) {
14661466 test ( `pii-query: ${ piiQuery . slice ( 0 , 40 ) } ` , async ( ) => {
14671467 const status = await runToolScenario ( {
@@ -1475,8 +1475,8 @@ describe("Category 9: Security", () => {
14751475 mockResponse : {
14761476 success : true ,
14771477 data : {
1478- pii_columns : [ { column : "ssn " , type : "SSN " } ] ,
1479- exposures : [ { query_section : "SELECT" , pii_type : "SSN " , risk : "high" } ] ,
1478+ pii_columns : [ { column : "tax_id " , type : "TAX_ID " } ] ,
1479+ exposures : [ { query_section : "SELECT" , pii_type : "TAX_ID " , risk : "high" } ] ,
14801480 } ,
14811481 } ,
14821482 } )
@@ -1754,7 +1754,7 @@ describe("Category 11: Persona Scenarios", () => {
17541754 success : true ,
17551755 data : {
17561756 columns : [
1757- { table : "customers" , column : "ssn " , pii_type : "SSN " , confidence : 0.99 } ,
1757+ { table : "customers" , column : "tax_id " , pii_type : "TAX_ID " , confidence : 0.99 } ,
17581758 { table : "customers" , column : "email" , pii_type : "EMAIL" , confidence : 0.98 } ,
17591759 ] ,
17601760 findings : [ ] ,
0 commit comments