dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
workflow_security_test.php
Go to the documentation of this file.
1
<?php
2
3
$root
= dirname(__DIR__);
4
$engineFile
=
$root
.
'/include/dbxWorkflowEngine.class.php'
;
5
$adminFile
= dirname(__DIR__, 2) .
'/dbxWorkflow_admin/include/dbxWorkflowAdmin.class.php'
;
6
$engine
= file_get_contents(
$engineFile
);
7
$admin
= file_get_contents(
$adminFile
);
8
9
$fail
=
static
function
(
string
$message,
int
$code): void {
10
fwrite(STDERR,
"FAIL: $message\n"
);
11
exit
($code);
12
};
13
14
if
(!is_string(
$engine
) || !is_string(
$admin
)) {
15
$fail
(
'Workflow-Quellen konnten nicht gelesen werden.'
, 1);
16
}
17
18
if
(strpos(
$engine
,
"check_action_token('dbxWorkflow.start'"
) ===
false
19
|| strpos(
$engine
,
'has_instance_action_token($iid)'
) ===
false
) {
20
$fail
(
'Start- oder Instanzmutationen sind nicht mit dbx_token abgesichert.'
, 2);
21
}
22
23
if
(strpos(
$engine
,
'guest_can_access_instance($iid)'
) ===
false
24
|| !preg_match(
'/select\\(\\$this->ddInstance,[\\s\\S]*?,\\s*1\\s*\\);/'
,
$engine
)) {
25
$fail
(
'Instanzzugriffe nutzen weder Gast-Sessionbindung noch DD-Pruefung.'
, 3);
26
}
27
28
if
(substr_count(
$engine
,
'$db->begin($this->ddInstance)'
) < 3
29
|| substr_count(
$engine
,
'$db->rollback($this->ddInstance)'
) < 3
30
|| substr_count(
$engine
,
'$db->commit($this->ddInstance)'
) < 3) {
31
$fail
(
'Workflow-Schritt, Automation und Abschluss sind nicht vollstaendig atomar.'
, 4);
32
}
33
34
if
(strpos(
$engine
,
"'status' => 'finishing'"
) ===
false
35
|| strpos(
$engine
,
"(int)\$db->_update_count !== 1"
) ===
false
) {
36
$fail
(
'Der externe Abschluss wird nicht atomar gegen Wiederholung beansprucht.'
, 5);
37
}
38
39
if
(preg_match(
"/\\\\\$nextUrl\\s*\\.\\s*'&proc_cmd=/"
,
$engine
) === 1
40
|| strpos(
$admin
,
"action_token('dbxWorkflow.instance.' . \$id)"
) ===
false
) {
41
$fail
(
'Ein zustandsaendernder Workflow-GET-Link wird noch ohne Token erzeugt.'
, 6);
42
}
43
44
echo
"OK workflow security\n"
;
$admin
$admin
Definition
configure_docs_access_20260728.php:61
$root
$root
Definition
db_access_boundary_test.php:3
$fail
$fail
Definition
dbxActionTokenAutomation_test.php:6
exit
exit
Definition
index.php:146
$adminFile
$adminFile
Definition
shop_admin_action_security_test.php:4
$fail
$fail
Definition
workflow_security_test.php:9
$engine
$engine
Definition
workflow_security_test.php:6
$engineFile
$engineFile
Definition
workflow_security_test.php:4
dbx
modules
dbxWorkflow
tests
workflow_security_test.php
Generated by
1.17.0