Feature/redos by lostsnow · Pull Request #111 · HXSecurity/DongTai-agent-python · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions dongtai_agent_python/policy/tracking.py
70 changes: 70 additions & 0 deletions dongtai_agent_python/policy_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,69 @@
}
]
},
{
"type": 4,
"enable": 1,
"value": "redos",
"details": [
{
"source": "P1,2,pattern,string",
"track": "true",
"target": "",
"value": "re.match",
"inherit": "false"
},
{
"source": "P1,2,pattern,string",
"track": "true",
"target": "",
"value": "re.fullmatch",
"inherit": "false"
},
{
"source": "P1,2,pattern,string",
"track": "true",
"target": "",
"value": "re.search",
"inherit": "false"
},
{
"source": "P1,3,pattern,string",
"track": "true",
"target": "",
"value": "re.sub",
"inherit": "false"
},
{
"source": "P1,3,pattern,string",
"track": "true",
"target": "",
"value": "re.subn",
"inherit": "false"
},
{
"source": "P1,2,pattern,string",
"track": "true",
"target": "",
"value": "re.split",
"inherit": "false"
},
{
"source": "P1,2,pattern,string",
"track": "true",
"target": "",
"value": "re.findall",
"inherit": "false"
},
{
"source": "P1,2,pattern,string",
"track": "true",
"target": "",
"value": "re.finditer",
"inherit": "false"
}
]
},
{
"type": 2,
"enable": 1,
Expand Down Expand Up @@ -895,6 +958,13 @@
"target": "R",
"value": "ldap3.utils.conv.escape_filter_chars",
"inherit": "false"
},
{
"source": "P1,pattern",
"track": "true",
"target": "R",
"value": "re.escape",
"inherit": "false"
}
]
}
Expand Down
4 changes: 4 additions & 0 deletions dongtai_agent_python/setting/const.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re

CONTAINER_DJANGO = 'Django'
CONTAINER_FLASK = 'Flask'

Expand All @@ -16,6 +18,8 @@
TAINT_SOURCE = 1
TAINT_TARGET = 2

EMPTY_PATTERN = type(re.compile(''))

C_API_PATCHES = [
'builtins.str.fstring',
'builtins.str.cformat',
Expand Down
1 change: 1 addition & 0 deletions setup.cfg