Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent notification MFA fatigue attacks #316

Merged
merged 7 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "symfony/*"
update-types: ["version-update:semver-major"]
update-types: ["version-update:semver-major"]
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
1 change: 1 addition & 0 deletions assets/typescript/AuthenticationPageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export class AuthenticationPageService {
this.switchToNotificationFailed();
break;
case 'no-device':
case 'no-trusted-device':
this.switchToNoDevice();
break;
}
Expand Down
9 changes: 9 additions & 0 deletions assets/typescript/__test__/AuthenticationPageService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ describe('AuthenticationPageService', () => {
expect(spy).toBeCalled();
});

it('Should show qr when there is no trusted-device cookie', () => {
if (!successCallback || !errorCallback) {
throw new Error('Should have started notification request');
}
const spy = jest.spyOn(context.authenticationPageService, 'switchToNoDevice');
successCallback('no-trusted-device');
expect(spy).toBeCalled();
});

it('Should handle connection errors', () => {
if (!successCallback || !errorCallback) {
throw new Error('Should have started notification request');
Expand Down
32 changes: 6 additions & 26 deletions ci/qa/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ parameters:
path: ../../dev/FileLogger.php

-
message: "#^Method Surfnet\\\\Tiqr\\\\Dev\\\\FileLogger\\:\\:log\\(\\) has parameter \\$message with no type specified\\.$#"
message: "#^Parameter \\#1 \\$record of method League\\\\Csv\\\\Writer\\:\\:insertOne\\(\\) expects array\\<float\\|int\\|string\\|Stringable\\|null\\>, array\\<int, mixed\\> given\\.$#"
count: 1
path: ../../dev/FileLogger.php

Expand Down Expand Up @@ -240,11 +240,6 @@ parameters:
count: 1
path: ../../src/Controller/TiqrAppApiController.php

-
message: "#^Parameter \\#2 \\$notificationType of method Surfnet\\\\Tiqr\\\\Controller\\\\TiqrAppApiController\\:\\:loginAction\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../src/Controller/TiqrAppApiController.php

-
message: "#^Parameter \\#2 \\$secret of method Surfnet\\\\Tiqr\\\\Tiqr\\\\TiqrUserRepositoryInterface\\:\\:createUser\\(\\) expects string, mixed given\\.$#"
count: 1
Expand All @@ -255,16 +250,6 @@ parameters:
count: 2
path: ../../src/Controller/TiqrAppApiController.php

-
message: "#^Parameter \\#3 \\$notificationAddress of method Surfnet\\\\Tiqr\\\\Controller\\\\TiqrAppApiController\\:\\:loginAction\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../src/Controller/TiqrAppApiController.php

-
message: "#^Parameter \\#3 \\$notificationType of method Surfnet\\\\Tiqr\\\\Controller\\\\TiqrAppApiController\\:\\:registerAction\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../src/Controller/TiqrAppApiController.php

-
message: "#^Parameter \\#3 \\$response of method Surfnet\\\\Tiqr\\\\Tiqr\\\\AuthenticationRateLimitServiceInterface\\:\\:authenticate\\(\\) expects string, mixed given\\.$#"
count: 1
Expand All @@ -275,11 +260,6 @@ parameters:
count: 2
path: ../../src/Controller/TiqrAppApiController.php

-
message: "#^Parameter \\#4 \\$notificationAddress of method Surfnet\\\\Tiqr\\\\Controller\\\\TiqrAppApiController\\:\\:registerAction\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../src/Controller/TiqrAppApiController.php

-
message: "#^Method Surfnet\\\\Tiqr\\\\DependencyInjection\\\\Configuration\\:\\:createBlockingConfig\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -332,7 +312,7 @@ parameters:

-
message: "#^Call to an undefined method Behat\\\\Mink\\\\Driver\\\\DriverInterface\\:\\:getClient\\(\\)\\.$#"
count: 2
count: 5
path: ../../src/Features/Context/TiqrContext.php

-
Expand All @@ -342,7 +322,7 @@ parameters:

-
message: "#^Cannot access offset 'sari' on mixed\\.$#"
count: 2
count: 3
path: ../../src/Features/Context/TiqrContext.php

-
Expand All @@ -352,12 +332,12 @@ parameters:

-
message: "#^Cannot access offset 1 on mixed\\.$#"
count: 1
count: 2
path: ../../src/Features/Context/TiqrContext.php

-
message: "#^Cannot access offset 2 on mixed\\.$#"
count: 1
count: 2
path: ../../src/Features/Context/TiqrContext.php

-
Expand All @@ -372,7 +352,7 @@ parameters:

-
message: "#^Cannot use array destructuring on mixed\\.$#"
count: 1
count: 2
path: ../../src/Features/Context/TiqrContext.php

-
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"ext-zlib": "*",
"incenteev/composer-parameter-handler": "^2.2",
"openconext/monitor-bundle": "^4.3.1",
"paragonie/halite": "^5.1",
"surfnet/stepup-bundle": "^6.0.17",
"surfnet/stepup-gssp-bundle": "^5.1",
"surfnet/stepup-saml-bundle": "^6.1",
Expand Down Expand Up @@ -48,7 +49,6 @@
"khanamiryan/qrcode-detector-decoder": "^2.0.2",
"league/csv": "^9.18",
"malukenho/docheader": "^1.1",
"mockery/mockery": "^1.6.12",
"overtrue/phplint": ">=9.4.2",
"phpmd/phpmd": "^2.15",
"phpstan/phpstan": "^1.12.11",
Expand Down Expand Up @@ -87,6 +87,7 @@
"unit-tests": "./ci/qa/phpunit",
"behat": "./ci/qa/behat",
"jest": "./ci/qa/jest",
"jscpd": "./ci/qa/jscpd",
"encore": [
"yarn encore production"
],
Expand Down
Loading
Loading