This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Model.aslan++
331 lines (265 loc) · 10.2 KB
/
Model.aslan++
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
specification Model
channel_model ACM
entity Environment {
types
pincode < text;
cookie < text;
opid < text;
userrequest < text;
fixedString < text;
communication < text;
symbols
eic, fcmsvc, eicapp, user, browser, idps, sps, fcmsrv: agent;
ch_B2IdPS, ch_IdPS2B: channel;
ch_U2B, ch_B2U: channel;
ch_IdPS2FCMSrv, ch_FCMSrv2IdPS: channel;
ch_FCMSrv2FCMSvc, ch_FCMSvc2FCMSrv: channel;
ch_FCMSvc2EICApp: channel;
ch_U2EICApp, ch_EICApp2U: channel;
ch_EICApp2IdPS, ch_IdPS2EICApp: channel;
ch_EICApp2EIC, ch_EIC2EICApp: channel;
ch_B2SPS, ch_SPS2B: channel;
ch_U2EIC: channel;
ch_B2IdPS_2, ch_IdPS2B_2: channel;
ch_U2B_2, ch_B2U_2: channel;
ch_IdPS2FCMSrv_2, ch_FCMSrv2IdPS_2: channel;
ch_FCMSrv2FCMSvc_2, ch_FCMSvc2FCMSrv_2: channel;
ch_FCMSvc2EICApp_2: channel;
ch_U2EICApp_2, ch_EICApp2U_2: channel;
ch_EICApp2IdPS_2, ch_IdPS2EICApp_2: channel;
ch_EICApp2EIC_2, ch_EIC2EICApp_2: channel;
ch_B2SPS_2, ch_SPS2B_2: channel;
ch_U2EIC_2: channel;
stringOK: fixedString;
request1, request2: userrequest;
useEIC: communication;
nonpublic idpcookie: cookie;
nonpublic pin: pincode;
nonpublic enrollmentDB(agent): agent*cookie set;
entity Session(EIC, FCMService, EICApp, User, Browser, SPServer, IdPServer, FCMServer: agent, Ch_B2IdPS, Ch_IdPS2B, Ch_U2B, Ch_B2U, Ch_IdPS2FCMSrv, Ch_FCMSrv2IdPS, Ch_FCMSrv2FCMSvc, Ch_FCMSvc2FCMSrv, Ch_FCMSvc2EICApp, Ch_U2EICApp, Ch_EICApp2U, Ch_EICApp2IdPS, Ch_IdPS2EICApp, Ch_EICApp2EIC, Ch_EIC2EICApp, Ch_B2SPS, Ch_SPS2B, Ch_U2EIC: channel, IdPCookie: cookie, Request: userrequest, PIN: pincode) {
entity User(Actor, Browser, EICApp, SPServer, IdPServer, EIC: agent, Ch_U2B, Ch_B2U, Ch_EICApp2U, Ch_U2EICApp, Ch_U2EIC: channel, Request: userrequest, PIN: pincode) {
body { % of User
Actor -Ch_U2B-> Browser: User_authn_to_SP:(Request);
select {
on(Browser -Ch_B2U-> Actor: IdPServer):{
Actor -Ch_U2B-> Browser: Actor;
select {
on(EICApp -Ch_EICApp2U-> Actor: Request):{
Actor -Ch_U2EICApp-> EICApp: stringOK;
select {
on(EICApp -Ch_EICApp2U-> Actor: EICApp):{
Actor -Ch_U2EICApp-> EICApp: PIN;
Actor -Ch_U2EIC-> EIC: useEIC;
}
}
}
}
}
}
}
}
entity Browser(Actor, User, IdPServer, SPServer: agent, Ch_B2U, Ch_B2IdPS: channel, IdPCookie: cookie) {
symbols
Request: userrequest;
body { % of Browser
select {
on(User -Ch_U2B-> Actor: ?Request):{
Actor -Ch_B2SPS-> SPServer: Request;
select {
on(SPServer -Ch_SPS2B-> Actor: Request):{
Actor -Ch_B2IdPS-> IdPServer: Request;
select {
on(IdPServer -Ch_IdPS2B-> Actor: IdPServer):{
Actor -Ch_B2U-> User: IdPServer;
select {
on(User -Ch_U2B-> Actor: User):{
Actor -Ch_B2IdPS-> IdPServer: User.IdPCookie;
select {
on(IdPServer -Ch_IdPS2B-> Actor: {IdPServer.User.SPServer}_inv(pk(IdPServer))):{
Actor -Ch_B2SPS-> SPServer: {IdPServer.User.SPServer}_inv(pk(IdPServer));
}
}
}
}
}
}
}
}
}
}
}
}
entity SPServer(Actor, Browser, IdPServer, User: agent, Ch_B2SPS, Ch_SPS2B: channel, Request: userrequest) {
body { % of SPServer
select {
on(Browser -Ch_B2SPS-> Actor: Request):{
Actor -Ch_SPS2B-> Browser: Request;
select {
on(Browser -Ch_B2SPS-> Actor: {IdPServer.User.Actor}_inv(pk(IdPServer))):{
User_authn_to_SP:(Request) := Request;
}
}
}
}
}
}
entity IdPServer(Actor, FCMServer, EICApp, User, SPServer, Browser, EIC: agent, Ch_B2IdPS, Ch_IdPS2FCMSrv, Ch_EICApp2IdPS, Ch_IdPS2EICApp: channel) {
symbols
IdPCookie: cookie;
OpId: opid;
Request: userrequest;
body { % of IdPServer
select {
on(Browser -Ch_B2IdPS-> Actor: ?Request):{
Actor -Ch_IdPS2B-> Browser: Actor;
select {
on(Browser -Ch_B2IdPS-> Actor: User.?IdPCookie &
enrollmentDB(Actor)->contains((User,?IdPCookie))):{
OpId := fresh();
Actor -Ch_IdPS2FCMSrv-> FCMServer: OpId.Request;
select {
on(EICApp -Ch_EICApp2IdPS-> Actor: OpId):{
Actor -Ch_IdPS2EICApp-> EICApp: OpId.Actor.SPServer;
select {
on(EICApp -Ch_EICApp2IdPS-> Actor: OpId.{OpId.Actor.SPServer}_inv(pk(EIC))):{
Actor -Ch_IdPS2B-> Browser: {Actor.User.SPServer}_inv(pk(Actor));
}
}
}
}
}
}
}
}
}
}
entity FCMServer(Actor, IdPServer, FCMService: agent, Ch_IdPS2FCMSrv, Ch_FCMSrv2FCMSvc: channel) {
symbols
OpId: opid;
Request: userrequest;
body { % of FCMServer
select{
on(IdPServer -Ch_IdPS2FCMSrv-> Actor: ?OpId.?Request):{
Actor -Ch_FCMSrv2FCMSvc-> FCMService: OpId.Request;
}
}
}
}
entity FCMService(Actor, FCMServer, EICApp: agent, Ch_FCMSrv2FCMSvc, Ch_FCMSvc2EICApp: channel) {
symbols
OpId: opid;
Request: userrequest;
body { % of FCMService
select {
on(FCMServer -Ch_FCMSrv2FCMSvc-> Actor: ?OpId.?Request):{
Actor -Ch_FCMSvc2EICApp-> EICApp: OpId.Request;
}
}
}
}
entity EICApp(Actor, FCMService, User, IdPServer, EIC: agent, Ch_FCMSvc2EICApp, Ch_EICApp2U, Ch_U2EICApp, Ch_EICApp2IdPS, Ch_IdPS2EICApp, Ch_EICApp2EIC, Ch_EIC2EICApp: channel) {
symbols
OpId: opid;
SPServer: agent;
PIN: pincode;
Request: userrequest;
body { % of EICApp
select {
on(FCMService -Ch_FCMSvc2EICApp-> Actor: ?OpId.?Request):{
Actor -Ch_EICApp2U-> User: Request;
select {
on(User -Ch_U2EICApp-> Actor: stringOK):{
Actor -Ch_EICApp2IdPS-> IdPServer: OpId;
select {
on(IdPServer -Ch_IdPS2EICApp-> Actor: OpId.IdPServer.?SPServer):{
Actor -Ch_EICApp2U-> User: Actor;
select {
on(User -Ch_U2EICApp-> Actor: ?PIN):{
Actor -Ch_EICApp2EIC-> EIC: OpId.IdPServer.SPServer.PIN;
select {
on(EIC -Ch_EIC2EICApp-> Actor: {OpId.IdPServer.SPServer}_inv(pk(EIC))):{
Actor -Ch_EICApp2IdPS-> IdPServer: OpId.{OpId.IdPServer.SPServer}_inv(pk(EIC));
}
}
}
}
}
}
}
}
}
}
}
}
entity EIC(Actor, EICApp, IdPServer, User: agent, Ch_EICApp2EIC, Ch_EIC2EICApp, Ch_U2EIC: channel, PIN: pincode) {
symbols
OpId: opid;
SPServer: agent;
body { % of EIC
select {
on(EICApp -Ch_EICApp2EIC-> Actor: ?OpId.IdPServer.?SPServer.PIN &
User -Ch_U2EIC-> Actor: useEIC):{
Actor -Ch_EIC2EICApp-> EICApp: {OpId.IdPServer.SPServer}_inv(pk(Actor));
}
}
}
}
body { % of Session
%--- Attackers ---%
%--- Follow the instructions to make the attacker effective ---%
% PCT
authentic_on(Ch_U2B, User); % comment out
%weakly_authentic(Ch_U2B); % uncomment
% use the same channel ch_u2b in the two sessions
% MDT
authentic_on(Ch_U2EICApp, User); % comment out
%weakly_authentic(Ch_U2EICApp); % uncomment
% use the same channel ch_u2eicapp in the two sessions
% CT
authentic_on(Ch_U2EIC, User); % comment out
%weakly_authentic(Ch_U2EIC); % uncomment
% use the same channel ch_u2eic in the two sessions
% ES, SS
confidential_to(Ch_U2EICApp, EICApp); % comment out
% SE
%iknows(PIN); % uncomment
% AD
%iknows(PIN); % uncomment
%iknows(IdPCookie); % uncomment
% MB
% uncomment iknows(IdPCookie) in AD
% MM
% comment out authentic_on in MDT
% comment out authentic_on in CT
% comment out confidential_to in ES, SS
confidential_to(Ch_FCMSvc2EICApp, EICApp); % comment out
authentic_on(Ch_EICApp2U, EICApp); % comment out
%--- End attackers ---%
% Channel properties
unilateral_conf_auth(Ch_B2IdPS, Ch_IdPS2B, IdPServer);
unilateral_conf_auth(Ch_B2SPS, Ch_SPS2B, SPServer);
bilateral_conf_auth(Ch_IdPS2FCMSrv, Ch_FCMSrv2IdPS, IdPServer, FCMServer);
unilateral_conf_auth(Ch_FCMSvc2FCMSrv, Ch_FCMSrv2FCMSvc, FCMServer);
authentic_on(Ch_FCMSvc2EICApp, FCMService);
unilateral_conf_auth(Ch_EICApp2IdPS, Ch_IdPS2EICApp, IdPServer);
unilateral_conf_auth(Ch_EICApp2EIC, Ch_EIC2EICApp, EIC);
new User(User, Browser, EICApp, SPServer, IdPServer, EIC, Ch_U2B, Ch_B2U, Ch_EICApp2U, Ch_U2EICApp, Ch_U2EIC, Request, PIN);
new Browser(Browser, User, IdPServer, SPServer, Ch_B2U, Ch_B2IdPS, IdPCookie);
new SPServer(SPServer, Browser, IdPServer, User, Ch_B2SPS, Ch_SPS2B, Request);
new IdPServer(IdPServer, FCMServer, EICApp, User, SPServer, Browser, EIC, Ch_B2IdPS, Ch_IdPS2FCMSrv, Ch_EICApp2IdPS, Ch_IdPS2EICApp);
new FCMServer(FCMServer, IdPServer, FCMService, Ch_IdPS2FCMSrv, Ch_FCMSrv2FCMSvc);
new FCMService(FCMService, FCMServer, EICApp, Ch_FCMSrv2FCMSvc, Ch_FCMSvc2EICApp);
new EICApp(EICApp, FCMService, User, IdPServer, EIC, Ch_FCMSvc2EICApp, Ch_EICApp2U, Ch_U2EICApp, Ch_EICApp2IdPS, Ch_IdPS2EICApp, Ch_EICApp2EIC, Ch_EIC2EICApp);
new EIC(EIC, EICApp, IdPServer, User, Ch_EICApp2EIC, Ch_EIC2EICApp, Ch_U2EIC, PIN);
}
goals
User_authn_to_SP:(_) User *->> SPServer;
}
body { % of Environment
% DB initialization
enrollmentDB(idps)->add((user, idpcookie));
% Session
new Session(eic, fcmsvc, eicapp, user, browser, sps, idps, fcmsrv, ch_B2IdPS, ch_IdPS2B, ch_U2B, ch_B2U, ch_IdPS2FCMSrv, ch_FCMSrv2IdPS, ch_FCMSrv2FCMSvc, ch_FCMSvc2FCMSrv, ch_FCMSvc2EICApp, ch_U2EICApp, ch_EICApp2U, ch_EICApp2IdPS, ch_IdPS2EICApp, ch_EICApp2EIC, ch_EIC2EICApp, ch_B2SPS, ch_SPS2B, ch_U2EIC, idpcookie, request1, pin);
new Session(eic, fcmsvc, eicapp, user, browser, sps, idps, fcmsrv, ch_B2IdPS_2, ch_IdPS2B_2, ch_U2B_2, ch_B2U_2, ch_IdPS2FCMSrv_2, ch_FCMSrv2IdPS_2, ch_FCMSrv2FCMSvc_2, ch_FCMSvc2FCMSrv_2, ch_FCMSvc2EICApp_2, ch_U2EICApp_2, ch_EICApp2U_2, ch_EICApp2IdPS_2, ch_IdPS2EICApp_2, ch_EICApp2EIC_2, ch_EIC2EICApp_2, ch_B2SPS_2, ch_SPS2B_2, ch_U2EIC_2, idpcookie, request2, pin);
}
}