Skip to content

Commit 7ae665c

Browse files
committed
Finish first draft of class
1 parent 1f027ff commit 7ae665c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/RemoteFlowSources.qll

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,23 @@ class HandlerParameterOfExposedService extends HandlerParameter {
3636

3737
/**
3838
* Reads of property belonging to a request parameter that is exposed to a protocol.
39+
* It currently models the following access paths:
40+
* - `req.data` (from `cds.Event.data`)
41+
* - `req.params` (from `cds.Request.params`)
42+
* - `req.headers` (from `cds.Event.headers`)
43+
* - `req.http.req` (from `cds.EventContext.http.req`)
44+
* - `req.id` (from `cds.EventContext.id`)
3945
*/
40-
class PayloadPropertyReadOfHandlerParameterOfExposedService extends RemoteFlowSource instanceof PropRead
46+
class UserProvidedPropertyReadOfHandlerParameterOfExposedService extends RemoteFlowSource instanceof PropRead
4147
{
4248
HandlerParameterOfExposedService handlerParameterOfExposedService;
4349

44-
PayloadPropertyReadOfHandlerParameterOfExposedService() {
45-
this = handlerParameterOfExposedService.getAPropertyRead()
50+
UserProvidedPropertyReadOfHandlerParameterOfExposedService() {
51+
/* 1. `req.(data|params|headers|id)` */
52+
this = handlerParameterOfExposedService.getAPropertyRead(["data", "params", "headers", "id"])
53+
or
54+
/* 2. `req.http.req` */
55+
this = handlerParameterOfExposedService.getAPropertyRead("http").getAPropertyRead("req")
4656
}
4757

4858
HandlerParameterOfExposedService getHandlerParameter() {
@@ -52,6 +62,7 @@ class PayloadPropertyReadOfHandlerParameterOfExposedService extends RemoteFlowSo
5262
Handler getHandler() { result = handlerParameterOfExposedService.getHandler() }
5363

5464
override string getSourceType() {
55-
result = "Parameter of an event handler belonging to an exposed service"
65+
result =
66+
"Tainted property read of the request parameter of an event handler belonging to an exposed service"
5667
}
5768
}

0 commit comments

Comments
 (0)