-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:designsecurity/progpilot
- Loading branch information
Showing
723 changed files
with
100,795 additions
and
9,734 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM php:8.1.13-cli | ||
|
||
RUN apt-get update && apt-get install -y vim git sudo | ||
|
||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
&& php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ | ||
&& php composer-setup.php \ | ||
&& php -r "unlink('composer-setup.php');" \ | ||
&& sudo mv composer.phar /usr/local/bin/composer | ||
|
||
ARG USERNAME=developer | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME |
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,7 @@ | ||
{ | ||
"name": "progpilot-linux", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"remoteUser": "developer" | ||
} |
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
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
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,89 @@ | ||
# definition states API | ||
|
||
Each definition has at least one state holding attributes like isTainted. The goal is to handle properties and array dataflow. | ||
|
||
For simple variable, the defaultState is enough, as dataflow is correctly performed by visitorDataFlow: | ||
``` | ||
// block 1 | ||
// foo defined in blockid 1 (defaultState = 1) | ||
// state 1 of foo tainted | ||
$foo = $_GET["p"]; | ||
if(rand()) { | ||
// block 2 | ||
// bar defined in blockid 2 (defaultState = 2) | ||
// state 2 of foo bar (get value of foo->currentState()) tainted | ||
$bar = $foo; | ||
} | ||
else { | ||
// block 3 | ||
// bar defined in blockid 3 (defaultState = 3) | ||
// state 3 of foo bar empty | ||
$bar = null; | ||
} | ||
// block 4 | ||
// bar search def: | ||
// * block2 $bar->getCurrentState() | ||
// * block3 $bar->getCurrentState() | ||
// merge states on block 4 of echo_arg0 | ||
echo $bar; | ||
``` | ||
|
||
For instances/properties variable, we need different states: | ||
``` | ||
// block 1 | ||
// instance defined in blockid 1 (defaultState = 1) | ||
$instance = new Object; | ||
if(rand()) { | ||
// block 2 | ||
// instance defined in blockid 1 (defaultState = 1) | ||
// state 2 of instance prop tainted | ||
$instance->prop = $_GET["p"]; | ||
echo $instance->prop; | ||
} | ||
else { | ||
// block 3 | ||
// instance defined in blockid 1 (defaultState = 1) | ||
// state 3 of instance prop "null" | ||
$instance->prop = "null"; | ||
echo $instance->prop; | ||
} | ||
// block 4 | ||
// we launch dataflow analysis for properties | ||
// parent of 4 = block 2, 3 | ||
// state 4 = merge(state 2,3) | ||
echo $instance->prop; | ||
``` | ||
|
||
|
||
Chained calls: | ||
``` | ||
// block 1 | ||
// instance1 defined in blockid 1 (defaultState = 1) | ||
$instance1 = new Object1; | ||
/* | ||
function func1() { | ||
// block 2 | ||
// instance2 defined in blockid 2 (defaultState = 2) | ||
$instance2 = new Object2; | ||
return $instance2; | ||
} | ||
function func2() { | ||
// block 3 | ||
// instance3 defined in blockid 3 (defaultState = 3) | ||
$instance3 = new Object3; | ||
return $instance3; | ||
} | ||
function func3() { | ||
echo $this->prop; | ||
} | ||
*/ | ||
$instance1->func1()->func2()->func3(); | ||
``` |
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
Oops, something went wrong.