forked from jvoisin/snuffleupagus
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
detect dummy or short encryption key
- Loading branch information
Showing
39 changed files
with
97 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/tests/broken_configuration/config/broken_conf_cookie_name_and_regexp.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name("my_cookie_name").name_r("my_cookie_regexp").encrypt(); |
2 changes: 1 addition & 1 deletion
2
src/tests/broken_configuration/config/config_encrypted_cookies_noname.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name("").encrypt(); | ||
sp.auto_cookie_secure.enable(); |
2 changes: 1 addition & 1 deletion
2
src/tests/broken_configuration/config/config_encrypted_regexp_cookies_bad_regexp.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name_r("^super_co[a-z+$").encrypt(); | ||
sp.auto_cookie_secure.enable(); |
1 change: 1 addition & 0 deletions
1
src/tests/broken_configuration/config/config_encryption_key_short.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sp.global.secret_key("abcdef"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--TEST-- | ||
Cookie encryption key too short | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | ||
--INI-- | ||
sp.configuration_file={PWD}/config/config_encryption_key_short.ini | ||
--COOKIE-- | ||
--ENV-- | ||
return <<<EOF | ||
REMOTE_ADDR=2001:0db8:0000:0000:0000:fe00:0042:8329 | ||
HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36 | ||
HTTPS=1 | ||
EOF; | ||
--FILE-- | ||
<?php | ||
?> | ||
--EXPECT-- | ||
PHP Fatal error: [snuffleupagus][2001:0db8:0000:0000:0000:fe00:0042:8329][config][log] The encryption key set on line 1 is too short. please use at least 10 bytes in Unknown on line 0 | ||
|
||
Fatal error: [snuffleupagus][2001:0db8:0000:0000:0000:fe00:0042:8329][config][log] The encryption key set on line 1 is too short. please use at least 10 bytes in Unknown on line 0 | ||
|
||
Fatal error: [snuffleupagus][2001:0db8:0000:0000:0000:fe00:0042:8329][config][log] Invalid configuration file in Unknown on line 0 | ||
Could not startup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/tests/broken_configuration_php8/config/broken_conf_cookie_name_and_regexp.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name("my_cookie_name").name_r("my_cookie_regexp").encrypt(); |
2 changes: 1 addition & 1 deletion
2
src/tests/broken_configuration_php8/config/config_encrypted_cookies_noname.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name("").encrypt(); | ||
sp.auto_cookie_secure.enable(); |
2 changes: 1 addition & 1 deletion
2
src/tests/broken_configuration_php8/config/config_encrypted_regexp_cookies_bad_regexp.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name_r("^super_co[a-z+$").encrypt(); | ||
sp.auto_cookie_secure.enable(); |
22 changes: 22 additions & 0 deletions
22
src/tests/broken_configuration_php8/encrypt_key_too_short.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Cookie encryption key too short | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | ||
<?php if (PHP_VERSION_ID < 80000) print "skip"; ?> | ||
--INI-- | ||
sp.configuration_file={PWD}/../broken_configuration/config/config_encryption_key_short.ini | ||
--COOKIE-- | ||
--ENV-- | ||
return <<<EOF | ||
REMOTE_ADDR=2001:0db8:0000:0000:0000:fe00:0042:8329 | ||
HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36 | ||
HTTPS=1 | ||
EOF; | ||
--FILE-- | ||
<?php | ||
?> | ||
--EXPECT-- | ||
Fatal error: [snuffleupagus][2001:0db8:0000:0000:0000:fe00:0042:8329][config][log] The encryption key set on line 1 is too short. please use at least 10 bytes in Unknown on line 0 | ||
|
||
Fatal error: [snuffleupagus][2001:0db8:0000:0000:0000:fe00:0042:8329][config][log] Invalid configuration file in Unknown on line 0 | ||
Could not startup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.unserialize_hmac.enable(); | ||
sp.log_media("php"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sp.session.sid_min_length("10").sid_max_length("32"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.unserialize_hmac.enable(); | ||
sp.log_media("syslog"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.unserialize_hmac.enable().simulation(); | ||
sp.log_media("syslog"); |
2 changes: 1 addition & 1 deletion
2
src/tests/cookies_encryption/config/config_encrypted_cookies.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name("super_cookie").encrypt(); | ||
sp.auto_cookie_secure.enable(); |
2 changes: 1 addition & 1 deletion
2
src/tests/cookies_encryption/config/config_encrypted_cookies_empty_env.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("SUPER_ENV_VAR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("SUPER_ENV_VAR"); | ||
sp.cookie.name("super_cookie").encrypt(); |
2 changes: 1 addition & 1 deletion
2
src/tests/cookies_encryption/config/config_encrypted_cookies_simulation.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name("super_cookie").encrypt().simulation(); | ||
sp.auto_cookie_secure.enable(); |
2 changes: 1 addition & 1 deletion
2
src/tests/cookies_encryption/config/config_encrypted_regexp_cookies.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name_r("^super_co[a-z]+$").encrypt(); | ||
sp.auto_cookie_secure.enable(); |
2 changes: 1 addition & 1 deletion
2
src/tests/cookies_encryption/config/config_encrypted_regexp_cookies_empty_env.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name_r("^super_coo[a-z]+$").encrypt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/tests/cookies_encryption_warning/config/encrypt_cookies_no_env.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.cookie.name("super_cookie").encrypt(); |
2 changes: 1 addition & 1 deletion
2
src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_env.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.cookie.name_r("^super_co[a-z]+$").encrypt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.cookie.name("super_cookie").encrypt(); | ||
sp.auto_cookie_secure.enable(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.session.encrypt(); |
2 changes: 1 addition & 1 deletion
2
src/tests/session_encryption/config/config_crypt_session_simul.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sp.global.secret_key("abcdef").cookie_env_var("REMOTE_ADDR"); | ||
sp.global.secret_key("abcdefGHIJ").cookie_env_var("REMOTE_ADDR"); | ||
sp.session.encrypt(); | ||
sp.session.simulation(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.unserialize_hmac.enable(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.unserialize_hmac.enable().simulation(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); | ||
sp.unserialize_hmac.enable().dump("/tmp/dump_result/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sp.global.secret_key("abcdef"); | ||
sp.global.secret_key("abcdefGHIJ"); |