diff --git a/src/main.h b/src/main.h index d5110c8..789b99a 100644 --- a/src/main.h +++ b/src/main.h @@ -12,9 +12,9 @@ // Version information (auto-updated by build system) // Using CRELAY_ prefix to avoid conflicts with nostr_core_lib VERSION macros #define CRELAY_VERSION_MAJOR 2 -#define CRELAY_VERSION_MINOR 0 -#define CRELAY_VERSION_PATCH 4 -#define CRELAY_VERSION "v2.0.4" +#define CRELAY_VERSION_MINOR 1 +#define CRELAY_VERSION_PATCH 0 +#define CRELAY_VERSION "v2.1.0" // Relay metadata (authoritative source for NIP-11 information) #define RELAY_NAME "C-Relay" diff --git a/test_results_20260401_091057.log b/test_results_20260401_091057.log new file mode 100644 index 0000000..1dce4e3 --- /dev/null +++ b/test_results_20260401_091057.log @@ -0,0 +1,18 @@ +2026-04-01 09:10:57 - ========================================== +2026-04-01 09:10:57 - C-Relay Comprehensive Test Suite Runner +2026-04-01 09:10:57 - ========================================== +2026-04-01 09:10:57 - Relay URL: ws://127.0.0.1:8888 +2026-04-01 09:10:57 - Log file: test_results_20260401_091057.log +2026-04-01 09:10:57 - Report file: test_report_20260401_091057.html +2026-04-01 09:10:57 - +2026-04-01 09:10:57 - Checking relay status at ws://127.0.0.1:8888... +2026-04-01 09:10:57 - \033[0;32m✓ Relay HTTP endpoint is accessible\033[0m +2026-04-01 09:10:57 - +2026-04-01 09:10:57 - Starting comprehensive test execution... +2026-04-01 09:10:57 - +2026-04-01 09:10:57 - \033[0;34m=== SECURITY TEST SUITES ===\033[0m +2026-04-01 09:10:57 - ========================================== +2026-04-01 09:10:57 - Running Test Suite: SQL Injection Tests +2026-04-01 09:10:57 - Description: Comprehensive SQL injection vulnerability testing +2026-04-01 09:10:57 - ========================================== +2026-04-01 09:10:57 - \033[0;31mERROR: Test script sql_injection_tests.sh not found\033[0m diff --git a/tests/test_results_20260401_091107.log b/tests/test_results_20260401_091107.log new file mode 100644 index 0000000..9a25b34 --- /dev/null +++ b/tests/test_results_20260401_091107.log @@ -0,0 +1,392 @@ +2026-04-01 09:11:07 - ========================================== +2026-04-01 09:11:07 - C-Relay Comprehensive Test Suite Runner +2026-04-01 09:11:07 - ========================================== +2026-04-01 09:11:07 - Relay URL: ws://127.0.0.1:8888 +2026-04-01 09:11:07 - Log file: test_results_20260401_091107.log +2026-04-01 09:11:07 - Report file: test_report_20260401_091107.html +2026-04-01 09:11:07 - +2026-04-01 09:11:07 - Checking relay status at ws://127.0.0.1:8888... +2026-04-01 09:11:07 - \033[0;32m✓ Relay HTTP endpoint is accessible\033[0m +2026-04-01 09:11:07 - +2026-04-01 09:11:07 - Starting comprehensive test execution... +2026-04-01 09:11:07 - +2026-04-01 09:11:07 - \033[0;34m=== SECURITY TEST SUITES ===\033[0m +2026-04-01 09:11:07 - ========================================== +2026-04-01 09:11:07 - Running Test Suite: SQL Injection Tests +2026-04-01 09:11:07 - Description: Comprehensive SQL injection vulnerability testing +2026-04-01 09:11:07 - ========================================== +========================================== +C-Relay SQL Injection Test Suite +========================================== +Testing against relay at ws://127.0.0.1:8888 + +=== Basic Connectivity Test === +Testing Basic connectivity... PASSED - Valid query works + +=== Authors Filter SQL Injection Tests === +Testing Authors filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: admin'--... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: /*... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: */... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: /**/... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: #... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (rejected with error) +Testing Authors filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (rejected with error) + +=== IDs Filter SQL Injection Tests === +Testing IDs filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: admin'--... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: /*... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: */... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: /**/... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: #... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (rejected with error) +Testing IDs filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (rejected with error) + +=== Kinds Filter SQL Injection Tests === +Testing Kinds filter with string injection... PASSED - SQL injection blocked (rejected with error) +Testing Kinds filter with negative value... PASSED - SQL injection blocked (rejected with error) +Testing Kinds filter with very large value... PASSED - SQL injection blocked (rejected with error) + +=== Search Filter SQL Injection Tests === +Testing Search filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (query sanitized) +Testing Search filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: admin'--... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: /*... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: */... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: /**/... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: #... PASSED - SQL injection blocked (query sanitized) +Testing Search filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (query sanitized) +Testing Search filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (query sanitized) +Testing Search filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (rejected with error) +Testing Search filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (rejected with error) + +=== Tag Filter SQL Injection Tests === +Testing #e tag filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: admin'--... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: /*... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: */... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: /**/... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: #... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (query sanitized) +Testing #e tag filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: admin'--... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: /*... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: */... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: /**/... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: #... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (query sanitized) +Testing #p tag filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: admin'--... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: /*... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: */... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: /**/... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: #... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (query sanitized) +Testing #t tag filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: admin'--... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: /*... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: */... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: /**/... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: #... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (query sanitized) +Testing #r tag filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 1' OR '1'='1... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ' OR 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: admin'--... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: /*... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: */... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: /**/... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: #... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ' AND 1=1 --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ' AND 1=2 --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (query sanitized) +Testing #d tag filter with payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (query sanitized) + +=== Timestamp Filter SQL Injection Tests === +Testing Since parameter injection... PASSED - SQL injection blocked (rejected with error) +Testing Until parameter injection... PASSED - SQL injection blocked (rejected with error) + +=== Limit Parameter SQL Injection Tests === +Testing Limit parameter injection... PASSED - SQL injection blocked (rejected with error) +Testing Limit with UNION... PASSED - SQL injection blocked (rejected with error) + +=== Complex Multi-Filter SQL Injection Tests === +Testing Multi-filter with authors injection... PASSED - SQL injection blocked (rejected with error) +Testing Multi-filter with search injection... PASSED - SQL injection blocked (rejected with error) +Testing Multi-filter with tag injection... PASSED - SQL injection blocked (query sanitized) + +=== COUNT Message SQL Injection Tests === +Testing COUNT with authors payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: '; DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: 1' OR '1'='1... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 1' OR '1'='1... PASSED - SQL injection blocked (query sanitized) +Testing COUNT with authors payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 1; SELECT * FROM sqlite_master; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ' OR 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ' OR 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: admin'--... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: admin'--... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 1' UNION SELECT password FROM users --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 1' AND SLEEP(5) --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 1' AND 1=1 WAITFOR DELAY '0:0:5' --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 1' AND 1=CAST((SELECT version()) AS INT) --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 1' AND 1=CONVERT(INT, (SELECT @@VERSION)) --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ' UNION SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ' UNION SELECT 1,2,3 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ' UNION ALL SELECT NULL,NULL,NULL --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: '; SELECT * FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: '; DELETE FROM events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: '; UPDATE events SET content='hacked' WHERE 1=1; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: /*... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: /*... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: */... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: */... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: /**/... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: /**/... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: #... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: #... PASSED - SQL injection blocked (query sanitized) +Testing COUNT with authors payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: 0x53514C5F494E4A454354494F4E... PASSED - SQL injection blocked (query sanitized) +Testing COUNT with authors payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: J1NSTCBJTkpFQ1RJT04gLS0=... PASSED - SQL injection blocked (query sanitized) +Testing COUNT with authors payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: '))); DROP TABLE events; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ')) UNION SELECT NULL; --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ' AND 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ' AND 1=1 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ' AND 1=2 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ' AND 1=2 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: ' AND (SELECT COUNT(*) FROM events) > 0 --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: '; EXEC master..xp_cmdshell 'net user' --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with authors payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (rejected with error) +Testing COUNT with search payload: '; DECLARE @host varchar(1024); SELECT @host=(SELECT TOP 1 master..sys.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='sa'); --... PASSED - SQL injection blocked (rejected with error) + +=== Edge Case SQL Injection Tests === +Testing Empty string injection... PASSED - SQL injection blocked (rejected with error) +Testing Null byte injection... PASSED - SQL injection blocked (silently rejected) +Testing Unicode injection... PASSED - SQL injection blocked (rejected with error) +Testing Very long injection payload... PASSED - SQL injection blocked (rejected with error) + +=== Subscription ID SQL Injection Tests === +Testing Subscription ID injection... PASSED - SQL injection blocked (rejected with error) +Testing Subscription ID with quotes... PASSED - SQL injection blocked (silently rejected) + +=== CLOSE Message SQL Injection Tests === +Testing CLOSE with injection... PASSED - SQL injection blocked (rejected with error) + +=== Test Results === +Total tests: 318 +Passed: 318 +Failed: 0 +✓ All SQL injection tests passed! +The relay appears to be protected against SQL injection attacks. +2026-04-01 09:11:14 - \033[0;32m✓ SQL Injection Tests PASSED\033[0m (Duration: 7s) +2026-04-01 09:11:14 - ========================================== +2026-04-01 09:11:14 - Running Test Suite: Filter Validation Tests +2026-04-01 09:11:14 - Description: Input validation for REQ and COUNT messages +2026-04-01 09:11:14 - ========================================== +=== C-Relay Filter Validation Tests === +Testing against relay at ws://127.0.0.1:8888 + +Testing Valid REQ message... PASSED +Testing Valid COUNT message... PASSED + +=== Testing Filter Array Validation === +Testing Non-object filter... PASSED +Testing Too many filters... PASSED + +=== Testing Authors Validation === +Testing Invalid author type... PASSED +Testing Invalid author hex... PASSED +Testing Too many authors... FAILED - Expected error 'error: too many authors', got: ["NOTICE", "error: invalid author hex string"] +2026-04-01 09:11:14 - \033[0;31m✗ Filter Validation Tests FAILED\033[0m (Duration: 0s)