FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql-queries/python/github/MassAssignment.qll at main · advanced-security/codeql-queries · GitHub
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
advanced-security
codeql-queries
Repository navigation
Code
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql-queries
/
python
/
github
/
MassAssignment.qll
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (42 loc) · 1.82 KB
Breadcrumbs
codeql-queries
/
python
/
github
/
MassAssignment.qll
Copy path
File metadata and controls
55 lines (42 loc) · 1.82 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import
python
import
semmle.python.dataflow.new.DataFlow
import
semmle.python.dataflow.new.TaintTracking
import
semmle.python.Concepts
import
semmle.python.dataflow.new.RemoteFlowSources
import
semmle.python.dataflow.new.BarrierGuards
import
semmle.python.ApiGraphs
import
github.LocalSources
module
MassAssignment
{
abstract
class
Sources
extends
DataFlow
::
Node
{
}
abstract
class
Sinks
extends
DataFlow
::
Node
{
}
abstract
class
Sanitizer
extends
DataFlow
::
Node
{
}
// Setattr build into Python
class
Setattr
extends
MassAssignment
::
Sinks
{
Setattr
(
)
{
(
// > `setattr(obj, SINK, value)`
this
=
API
::
builtin
(
"setattr"
)
.
getACall
(
)
.
getArg
(
1
)
or
// > __setattr__(SINK, value)
exists
(
Value
value
,
CallNode
call
|
value
.
getName
(
)
=
"__setattr__"
and
call
=
value
.
getACall
(
)
and
this
.
asCfgNode
(
)
=
call
.
getArg
(
0
)
)
)
and
this
.
getScope
(
)
.
inSource
(
)
}
}
class
MassAssignmentLocalConfig
extends
TaintTracking
::
Configuration
{
MassAssignmentLocalConfig
(
)
{
this
=
"Mass Assignment Config"
}
override
predicate
isSource
(
DataFlow
::
Node
source
)
{
source
instanceof
LocalSources
::
Range
}
override
predicate
isSink
(
DataFlow
::
Node
sink
)
{
sink
instanceof
MassAssignment
::
Sinks
}
override
predicate
isSanitizer
(
DataFlow
::
Node
node
)
{
node
instanceof
MassAssignment
::
Sanitizer
}
}
class
MassAssignmentConfig
extends
TaintTracking
::
Configuration
{
MassAssignmentConfig
(
)
{
this
=
"Mass Assignment Config"
}
override
predicate
isSource
(
DataFlow
::
Node
source
)
{
source
instanceof
RemoteFlowSource
::
Range
}
override
predicate
isSink
(
DataFlow
::
Node
sink
)
{
sink
instanceof
MassAssignment
::
Sinks
}
override
predicate
isSanitizer
(
DataFlow
::
Node
node
)
{
node
instanceof
MassAssignment
::
Sanitizer
}
}
}
Back
|
FazBrowse Home
|
New Git URL