Skip to content

Commit

Permalink
Merge pull request #79 from AikidoSec/whitelist-php-streams
Browse files Browse the repository at this point in the history
Whitelist php streams from fopen hooks
  • Loading branch information
willem-delbare authored Nov 8, 2024
2 parents 855e775 + d73e3e9 commit 36f02ba
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/agent/globals/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package globals

const (
Version = "1.0.93"
Version = "1.0.94"
ConfigUpdatedAtMethod = "GET"
ConfigUpdatedAtAPI = "/config"
ConfigAPIMethod = "GET"
Expand Down
5 changes: 5 additions & 0 deletions lib/php-extension/HandlePathAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

/* Helper for handle pre file path access */
void helper_handle_pre_file_path_access(char *filename, EVENT_ID &eventId) {
if (strncmp(filename, "php://", 6) == 0) {
// Whitelist php:// streams as they are often used by PHP frameworks a lot
return;
}

// if filename starts with http:// or https://, it's a URL so we treat it as an outgoing request
if (strncmp(filename, "http://", 7) == 0 ||
strncmp(filename, "https://", 8) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/php-extension/include/php_aikido.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
extern zend_module_entry aikido_module_entry;
#define phpext_aikido_ptr &aikido_module_entry

#define PHP_AIKIDO_VERSION "1.0.93"
#define PHP_AIKIDO_VERSION "1.0.94"

#if defined(ZTS) && defined(COMPILE_DL_AIKIDO)
ZEND_TSRMLS_CACHE_EXTERN()
Expand Down
2 changes: 1 addition & 1 deletion lib/request-processor/globals/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ var CloudConfig CloudConfigData
var CloudConfigMutex sync.Mutex

const (
Version = "1.0.93"
Version = "1.0.94"
)
2 changes: 1 addition & 1 deletion package/rpm/aikido.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: aikido-php-firewall
Version: 1.0.93
Version: 1.0.94
Release: 1
Summary: Aikido PHP Extension
License: GPL
Expand Down

0 comments on commit 36f02ba

Please sign in to comment.