Skip to content

Commit

Permalink
Draft of how to overcome problem
Browse files Browse the repository at this point in the history
  • Loading branch information
estringana committed Jan 7, 2025
1 parent 9f893f2 commit 22bc61b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions appsec/tests/extension/push_params_block_02.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ class SomeIntegration {

$integration = new SomeIntegration();
$integration->init();
echo PHP_EOL;
var_dump(ltrim(" Calling wrapped function"));
var_dump("THIS SHOULD NOT GET IN THE OUTPUT");

?>
--EXPECTHEADERS--
Status: 404 Not Found
Content-type: text/html; charset=UTF-8
Content-type: text/html;charset=UTF-8
--EXPECTF--
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>You've been blocked</title><style>a,body,div,html,span{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}body{background:-webkit-radial-gradient(26% 19%,circle,#fff,#f4f7f9);background:radial-gradient(circle at 26% 19%,#fff,#f4f7f9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;width:100%;min-height:100vh;line-height:1;flex-direction:column}p{display:block}main{text-align:center;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;flex-direction:column}p{font-size:18px;line-height:normal;color:#646464;font-family:sans-serif;font-weight:400}a{color:#4842b7}footer{width:100%;text-align:center}footer p{font-size:16px}</style></head><body><main><p>Sorry, you cannot access this page. Please contact the customer service team.</p></main><footer><p>Security provided by <a href="https://www.datadoghq.com/product/security-platform/application-security-monitoring/" target="_blank">Datadog</a></p></footer></body></html>
3 changes: 3 additions & 0 deletions zend_abstract_interface/symbols/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ static inline int zai_symbol_try_call(zend_fcall_info *fci, zend_fcall_info_cach
ret = zend_call_function(fci, fcc);
} zend_catch {
ret = 2;
if (PG(last_error_message) && strstr(ZSTR_VAL(PG(last_error_message)), "Datadog blocked the request")) {
zend_bailout();
}
} zend_end_try();
return ret;
}
Expand Down

0 comments on commit 22bc61b

Please sign in to comment.