passbolt-browser-extension 5.14.3 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/.devcontainer/Dockerfile +1 -1
  2. package/.devcontainer/devcontainer.json +1 -1
  3. package/.github/workflows/codeql-analysis.yml +1 -1
  4. package/.github/workflows/release_candidate.yaml +1 -1
  5. package/CHANGELOG.md +71 -1
  6. package/RELEASE_NOTES.md +89 -5
  7. package/build-safari-extension/Passbolt-Safari-Extension/Passbolt - password manager.xcodeproj/project.pbxproj +8 -8
  8. package/package.json +7 -7
  9. package/src/all/background_page/pagemod/appBootstrapPagemod.js +15 -5
  10. package/src/all/background_page/pagemod/appBootstrapPagemod.test.js +17 -0
  11. package/src/all/background_page/service/accountRecovery/buildApprovedAccountRecoveryUserSettingEntityService.js +2 -2
  12. package/src/all/background_page/service/auth/startLoopAuthSessionCheckService.js +13 -2
  13. package/src/all/background_page/service/auth/startLoopAuthSessionCheckService.test.js +28 -0
  14. package/src/all/background_page/service/authenticationStatusService.js +3 -0
  15. package/src/all/background_page/service/authenticationStatusService.test.js +10 -0
  16. package/src/all/background_page/service/crypto/cryptoRandomValuesService.js +19 -0
  17. package/src/all/background_page/service/crypto/cryptoRandomValuesService.test.js +22 -0
  18. package/src/all/background_page/service/siteSettings/findAndUpdateSiteSettingsLocalStorageService.js +9 -3
  19. package/src/all/background_page/service/siteSettings/findAndUpdateSiteSettingsLocalStorageService.test.js +18 -0
  20. package/src/all/background_page/service/siteSettings/getOrFindSiteSettingsService.js +10 -2
  21. package/src/all/background_page/service/siteSettings/getOrFindSiteSettingsService.test.js +42 -0
  22. package/src/chrome/manifest.json +1 -1
  23. package/src/chrome-mv3/manifest.json +1 -1
  24. package/src/firefox/manifest.json +1 -1
  25. package/src/safari/manifest.json +1 -1
  26. package/webpack/passboltEnvPlugin.js +9 -10
@@ -1,4 +1,4 @@
1
- FROM mcr.microsoft.com/devcontainers/typescript-node:22
1
+ FROM mcr.microsoft.com/devcontainers/typescript-node:22@sha256:4f634c449931ac2aff140f9fac5825413196e631ccc0eb7afd17033144253be4
2
2
 
3
3
  RUN npm install -g @aikidosec/safe-chain \
4
4
  && install -d -o node -g node /home/node/.safe-chain \
@@ -5,7 +5,7 @@
5
5
  "service": "devcontainer",
6
6
  "workspaceFolder": "/workspaces/passbolt-browser-extension",
7
7
  "features": {
8
- "ghcr.io/devcontainers/features/git:1": {}
8
+ "ghcr.io/devcontainers/features/git:1@sha256:fd75977de13a9979000e0e78baf949adb0ca71d2398995fa22e0a36d7e7e7fe2": {}
9
9
  },
10
10
  "customizations": {
11
11
  "vscode": {
@@ -16,7 +16,7 @@ jobs:
16
16
 
17
17
  steps:
18
18
  - name: Checkout repository
19
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
19
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
20
  with:
21
21
  persist-credentials: false
22
22
  # We must fetch at least the immediate parents so that if this is
@@ -12,7 +12,7 @@ jobs:
12
12
  permissions:
13
13
  contents: write
14
14
  steps:
15
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
15
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16
16
  with:
17
17
  persist-credentials: false
18
18
  - env:
package/CHANGELOG.md CHANGED
@@ -4,6 +4,75 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [5.15.0] - 2026-08-20
8
+ ### Added
9
+ PB-53103 - AUTOFILL EPIC - Autofill improvements
10
+ PB-53105 - Add ShadowDomDictionary and InFormFieldDictionary
11
+ PB-53107 - Create ShadowRootResolverService
12
+ PB-53108 - Add ShadowRootCollectorService
13
+ PB-53109 - Add ShadowRootCacheService
14
+ PB-53110 - Add ShadowMutationObserverService
15
+ PB-53120 - Add ShadowDomQueryService
16
+ PB-53121 - Add ShadowDomFocusHealerService
17
+ PB-53122 - Add InFormFieldGeometryService
18
+ PB-53123 - Update InFormCallToActionField to use ShadowRootCacheService, ShadowDomQueryService and InFormFieldGeometryService
19
+ PB-53124 - Find username element through shadow doms if needed
20
+ PB-53125 - Switch from DomUtils to InFormFieldGeometryService in InformMenuField
21
+ PB-53126 - Listen for focus event on the whole page to detect missed inputs
22
+ PB-53127 - Refactor InFormManager to use previously created services
23
+ PB-53128 - Refactor DomUtils
24
+ PB-53574 - Shadow dom should solve duck-types as a shadow root
25
+ PB-53619 - Shadow dom piercing is missing on the autofill resolver
26
+ PB-53394 - Global new design of share dialog
27
+
28
+ ### Fixed
29
+ PB-48042 - Sign-in with SSO secondary CTA alignment on sign-in with passphrase page
30
+ PB-52353 - Clicking on several items is not possible when filtering the grid by expired
31
+ PB-52539 - Left side bar alignment adjustments
32
+ PB-53329 - Discrepancy in data (group or member) display when we remove and add them again
33
+ PB-53819 - Fix height for share dialog badges and dropdowns
34
+ PB-53820 - Fix revert button disappearing at certain widths
35
+ PB-53921 - Fix application crash after creating a resource in a shared folder while transferring ownership
36
+ PB-53497 - Fix crash when is-authenticated endpoint response is not JSON
37
+
38
+ ### Security
39
+ PB-53357 - Fix js-yaml GCVE-0-2026-59869 - HIGH CVSS3.1
40
+ PB-53358 - Fix brace-expansion GHSA-3jxr-9vmj-r5cp - HIGH CVSS4.0
41
+ PB-53386 - Potential Cross Site Scripting (XSS) via window.location.href (Low)
42
+ PB-53391 - Fix svgo GHSA-2p49-hgcm-8545 - HIGH CVSS3.1
43
+ PB-53392 - Fix fast-uri GHSA-4c8g-83qw-93j6 - HIGH CVSS3.1
44
+ PB-53401 - Fix shell-quote GHSA-395f-4hp3-45gv - HIGH CVSS4.0
45
+ PB-53402 - Fix websocket-driver GHSA-xv26-6w52-cph6 - CRITICAL CVSS4.0
46
+ PB-53403 - Fix postcss GHSA-r28c-9q8g-f849 - HIGH CVSS3.1
47
+ PB-53404 - Fix webpack-dev-server GHSA-m28w-2pqf-7qgj - MEDIUM CVSS3.1
48
+ PB-53405 - Fix body-parser GHSA-v422-hmwv-36x6 - LOW CVSS3.1
49
+ PB-53550 - Small upgrade for js-yaml (Low)
50
+ PB-53552 - Fix fast-uri GHSA-7p8r-x3mc-p8w7 - HIGH CVSS3.1
51
+ PB-53559 - Fix brace-expansion GHSA-mh99-v99m-4gvg - HIGH CVSS3.1
52
+ PB-53942 - Fix image-size GHSA-5p2g-fcmc-qvqq - HIGH CVSS4.0
53
+ PB-53357 - Fix js-yaml GCVE-0-2026-59869 - HIGH CVSS3.1
54
+ PB-53358 - Fix brace-expansion GHSA-3jxr-9vmj-r5cp - HIGH CVSS4.0
55
+ PB-53385 - Fix adm-zip GHSA-xcpc-8h2w-3j85 - HIGH CVSS3.1
56
+ PB-53391 - Fix svgo GHSA-2p49-hgcm-8545 - HIGH CVSS3.1
57
+ PB-53392 - Fix fast-uri GHSA-4c8g-83qw-93j6 - HIGH CVSS3.1
58
+ PB-53401 - Fix shell-quote GHSA-395f-4hp3-45gv - HIGH CVSS4.0
59
+ PB-53550 - Small upgrade for js-yaml (Low)
60
+ PB-53552 - Fix fast-uri GHSA-7p8r-x3mc-p8w7 - HIGH CVSS3.1
61
+ PB-53553 - Fix undici GHSA-4cwx-7wf7-3272 - HIGH CVSS3.1
62
+ PB-53559 - Fix brace-expansion GHSA-mh99-v99m-4gvg - HIGH CVSS3.1
63
+ PB-53940 - Small upgrade for @xmldom/xmldom (High)
64
+
65
+ ### Maintenance
66
+ PB-53204 - Reverse passboltEnvPlugin logic
67
+ PB-53671 - Replace the forked secrets.js library with a native randomHex
68
+ PB-53764 - Update Storybook libraries in passbolt-styleguide to remove vulnerable dependencies while keeping the Storybook scripts functional
69
+ PB-53934 - Use correct version for github-pages-deploy-action
70
+ PB-53972 - Clean comment in ShareDialog
71
+
72
+ ## [5.14.4] - 2026-08-10
73
+ ### Fixed
74
+ - PB-53681: Safari applies URLs redirection on created resource too early
75
+
7
76
  ## [5.14.3] - 2026-08-03
8
77
  ### Fixed
9
78
  - PB-53406: PCD: do not display when editing a shared resource metadata only
@@ -2934,7 +3003,8 @@ self registration settings option in the left-side bar
2934
3003
  - AP: User with plugin installed
2935
3004
  - LU: Logged in user
2936
3005
 
2937
- [Unreleased]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.14.3...HEAD
3006
+ [Unreleased]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.14.4...HEAD
3007
+ [5.14.4]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.14.3...v5.14.4
2938
3008
  [5.14.3]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.14.2...v5.14.3
2939
3009
  [5.14.2]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.14.1...v5.14.2
2940
3010
  [5.14.1]: https://github.com/passbolt/passbolt_browser_extension/compare/v5.14.0...v5.14.1
package/RELEASE_NOTES.md CHANGED
@@ -1,9 +1,93 @@
1
- # v5.14.3
1
+ # v5.15.0
2
+ Passbolt 5.15.0 improves form detection for autofill, makes permission changes easier to review, and adds several security and administration improvements. This release also introduces new session management tooling and additional safeguards for Passbolt Pro.
3
+
4
+ ## Clearer permission confirmation changes
5
+ The permission confirmation dialog has been visually improved to make access changes clearer before they are applied. Users can now understand the impact of permission changes more clearly before applying them. New badges show whether permissions are being added, modified, or deleted.
6
+
7
+ Deleted permissions can also be rolled back to their original state before confirmation, making access changes easier to review and correct.
8
+
9
+ ## Improved autofill
10
+ Passbolt 5.15.0 continues the process to improve the autofill feature in several phases. This first iteration improves detection on websites that were previously unsupported, enhancing the end-user experience by identifying complex forms and simplifying it.
11
+
12
+ Upcoming releases will have iterations focusing on reducing false positives and refining the classification further.
13
+
14
+ ## Miscellaneous Improvements
15
+ ### Database-backed sessions for Passbolt API (Beta)
16
+
17
+ Passbolt API now supports database-backed sessions in beta, helping improve API performance and simplify high-availability deployments without relying on third-party caching systems such as Redis. By removing file-based session locking, requests from the same user can run in parallel, while load-balanced deployments no longer require sticky sessions.
18
+
19
+ The feature must be enabled manually by a system administrator.
20
+
21
+ A new healthcheck now identifies the active session provider, helping administrators verify their session setup. A new purge command can clear stored sessions when needed, while the sessions table is created automatically if it is not already in place.
22
+
23
+ ### Deleted user notifications
24
+
25
+ Administrators are now notified whenever any user is deleted, giving them better visibility into account removals across the organisation. Previously, notifications were sent only when an administrator was deleted.
26
+
27
+ ## Conclusion
28
+ As usual, release 5.15.0 has dependency updates Many thanks to everyone who provided feedback, reported bugs, and contributed to making passbolt better!
29
+
30
+ ## Changelogs
31
+ ### Added
32
+ PB-53103 - AUTOFILL EPIC - Autofill improvements
33
+ PB-53105 - Add ShadowDomDictionary and InFormFieldDictionary
34
+ PB-53107 - Create ShadowRootResolverService
35
+ PB-53108 - Add ShadowRootCollectorService
36
+ PB-53109 - Add ShadowRootCacheService
37
+ PB-53110 - Add ShadowMutationObserverService
38
+ PB-53120 - Add ShadowDomQueryService
39
+ PB-53121 - Add ShadowDomFocusHealerService
40
+ PB-53122 - Add InFormFieldGeometryService
41
+ PB-53123 - Update InFormCallToActionField to use ShadowRootCacheService, ShadowDomQueryService and InFormFieldGeometryService
42
+ PB-53124 - Find username element through shadow doms if needed
43
+ PB-53125 - Switch from DomUtils to InFormFieldGeometryService in InformMenuField
44
+ PB-53126 - Listen for focus event on the whole page to detect missed inputs
45
+ PB-53127 - Refactor InFormManager to use previously created services
46
+ PB-53128 - Refactor DomUtils
47
+ PB-53574 - Shadow dom should solve duck-types as a shadow root
48
+ PB-53619 - Shadow dom piercing is missing on the autofill resolver
49
+ PB-53394 - Global new design of share dialog
2
50
 
3
51
  ### Fixed
4
- - PB-53406: PCD: do not display when editing a shared resource metadata only
5
- - PB-53471: PCD: creation of a shared resource in a non owned folder should display the PCD in read-only
6
- - PB-53546: Fix in form menu integration disablement behaviour
52
+ PB-48042 - Sign-in with SSO secondary CTA alignment on sign-in with passphrase page
53
+ PB-52353 - Clicking on several items is not possible when filtering the grid by expired
54
+ PB-52539 - Left side bar alignment adjustments
55
+ PB-53329 - Discrepancy in data (group or member) display when we remove and add them again
56
+ PB-53819 - Fix height for share dialog badges and dropdowns
57
+ PB-53820 - Fix revert button disappearing at certain widths
58
+ PB-53921 - Fix application crash after creating a resource in a shared folder while transferring ownership
59
+ PB-53497 - Fix crash when is-authenticated endpoint response is not JSON
60
+
61
+ ### Security
62
+ PB-53357 - Fix js-yaml GCVE-0-2026-59869 - HIGH CVSS3.1
63
+ PB-53358 - Fix brace-expansion GHSA-3jxr-9vmj-r5cp - HIGH CVSS4.0
64
+ PB-53386 - Potential Cross Site Scripting (XSS) via window.location.href (Low)
65
+ PB-53391 - Fix svgo GHSA-2p49-hgcm-8545 - HIGH CVSS3.1
66
+ PB-53392 - Fix fast-uri GHSA-4c8g-83qw-93j6 - HIGH CVSS3.1
67
+ PB-53401 - Fix shell-quote GHSA-395f-4hp3-45gv - HIGH CVSS4.0
68
+ PB-53402 - Fix websocket-driver GHSA-xv26-6w52-cph6 - CRITICAL CVSS4.0
69
+ PB-53403 - Fix postcss GHSA-r28c-9q8g-f849 - HIGH CVSS3.1
70
+ PB-53404 - Fix webpack-dev-server GHSA-m28w-2pqf-7qgj - MEDIUM CVSS3.1
71
+ PB-53405 - Fix body-parser GHSA-v422-hmwv-36x6 - LOW CVSS3.1
72
+ PB-53550 - Small upgrade for js-yaml (Low)
73
+ PB-53552 - Fix fast-uri GHSA-7p8r-x3mc-p8w7 - HIGH CVSS3.1
74
+ PB-53559 - Fix brace-expansion GHSA-mh99-v99m-4gvg - HIGH CVSS3.1
75
+ PB-53942 - Fix image-size GHSA-5p2g-fcmc-qvqq - HIGH CVSS4.0
76
+ PB-53357 - Fix js-yaml GCVE-0-2026-59869 - HIGH CVSS3.1
77
+ PB-53358 - Fix brace-expansion GHSA-3jxr-9vmj-r5cp - HIGH CVSS4.0
78
+ PB-53385 - Fix adm-zip GHSA-xcpc-8h2w-3j85 - HIGH CVSS3.1
79
+ PB-53391 - Fix svgo GHSA-2p49-hgcm-8545 - HIGH CVSS3.1
80
+ PB-53392 - Fix fast-uri GHSA-4c8g-83qw-93j6 - HIGH CVSS3.1
81
+ PB-53401 - Fix shell-quote GHSA-395f-4hp3-45gv - HIGH CVSS4.0
82
+ PB-53550 - Small upgrade for js-yaml (Low)
83
+ PB-53552 - Fix fast-uri GHSA-7p8r-x3mc-p8w7 - HIGH CVSS3.1
84
+ PB-53553 - Fix undici GHSA-4cwx-7wf7-3272 - HIGH CVSS3.1
85
+ PB-53559 - Fix brace-expansion GHSA-mh99-v99m-4gvg - HIGH CVSS3.1
86
+ PB-53940 - Small upgrade for @xmldom/xmldom (High)
7
87
 
8
88
  ### Maintenance
9
- - PB-53384: Add logs for errors on the process "add user to group"
89
+ PB-53204 - Reverse passboltEnvPlugin logic
90
+ PB-53671 - Replace the forked secrets.js library with a native randomHex
91
+ PB-53764 - Update Storybook libraries in passbolt-styleguide to remove vulnerable dependencies while keeping the Storybook scripts functional
92
+ PB-53934 - Use correct version for github-pages-deploy-action
93
+ PB-53972 - Clean comment in ShareDialog
@@ -595,7 +595,7 @@
595
595
  buildSettings = {
596
596
  CODE_SIGN_ENTITLEMENTS = "Passbolt - password manager Extension/Passbolt - password manager Extension.entitlements";
597
597
  CODE_SIGN_STYLE = Automatic;
598
- CURRENT_PROJECT_VERSION = 7;
598
+ CURRENT_PROJECT_VERSION = 9;
599
599
  DEAD_CODE_STRIPPING = YES;
600
600
  DEVELOPMENT_TEAM = UHX38H22ZT;
601
601
  ENABLE_APP_SANDBOX = YES;
@@ -622,7 +622,7 @@
622
622
  "@executable_path/../../../../Frameworks",
623
623
  );
624
624
  MACOSX_DEPLOYMENT_TARGET = 15.6;
625
- MARKETING_VERSION = 5.12.1;
625
+ MARKETING_VERSION = 5.14.4;
626
626
  OTHER_LDFLAGS = (
627
627
  "-framework",
628
628
  SafariServices,
@@ -641,7 +641,7 @@
641
641
  buildSettings = {
642
642
  CODE_SIGN_ENTITLEMENTS = "Passbolt - password manager Extension/Passbolt - password manager Extension.entitlements";
643
643
  CODE_SIGN_STYLE = Automatic;
644
- CURRENT_PROJECT_VERSION = 7;
644
+ CURRENT_PROJECT_VERSION = 9;
645
645
  DEAD_CODE_STRIPPING = YES;
646
646
  DEVELOPMENT_TEAM = UHX38H22ZT;
647
647
  ENABLE_APP_SANDBOX = YES;
@@ -668,7 +668,7 @@
668
668
  "@executable_path/../../../../Frameworks",
669
669
  );
670
670
  MACOSX_DEPLOYMENT_TARGET = 15.6;
671
- MARKETING_VERSION = 5.12.1;
671
+ MARKETING_VERSION = 5.14.4;
672
672
  OTHER_LDFLAGS = (
673
673
  "-framework",
674
674
  SafariServices,
@@ -690,7 +690,7 @@
690
690
  CODE_SIGN_ENTITLEMENTS = "Passbolt - password manager/Passbolt - password manager.entitlements";
691
691
  CODE_SIGN_STYLE = Automatic;
692
692
  COMBINE_HIDPI_IMAGES = YES;
693
- CURRENT_PROJECT_VERSION = 7;
693
+ CURRENT_PROJECT_VERSION = 9;
694
694
  DEAD_CODE_STRIPPING = YES;
695
695
  DEVELOPMENT_TEAM = UHX38H22ZT;
696
696
  ENABLE_APP_SANDBOX = YES;
@@ -718,7 +718,7 @@
718
718
  "@executable_path/../Frameworks",
719
719
  );
720
720
  MACOSX_DEPLOYMENT_TARGET = 15.6;
721
- MARKETING_VERSION = 5.12.1;
721
+ MARKETING_VERSION = 5.14.4;
722
722
  OTHER_LDFLAGS = (
723
723
  "-framework",
724
724
  SafariServices,
@@ -741,7 +741,7 @@
741
741
  CODE_SIGN_ENTITLEMENTS = "Passbolt - password manager/Passbolt - password manager.entitlements";
742
742
  CODE_SIGN_STYLE = Automatic;
743
743
  COMBINE_HIDPI_IMAGES = YES;
744
- CURRENT_PROJECT_VERSION = 7;
744
+ CURRENT_PROJECT_VERSION = 9;
745
745
  DEAD_CODE_STRIPPING = YES;
746
746
  DEVELOPMENT_TEAM = UHX38H22ZT;
747
747
  ENABLE_APP_SANDBOX = YES;
@@ -769,7 +769,7 @@
769
769
  "@executable_path/../Frameworks",
770
770
  );
771
771
  MACOSX_DEPLOYMENT_TARGET = 15.6;
772
- MARKETING_VERSION = 5.12.1;
772
+ MARKETING_VERSION = 5.14.4;
773
773
  OTHER_LDFLAGS = (
774
774
  "-framework",
775
775
  SafariServices,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passbolt-browser-extension",
3
- "version": "5.14.3",
3
+ "version": "5.15.0",
4
4
  "license": "AGPL-3.0",
5
5
  "copyright": "Copyright 2025 Passbolt SA",
6
6
  "description": "Passbolt web extension for the open source password manager for teams",
@@ -21,10 +21,9 @@
21
21
  "kdbxweb": "2.1.1",
22
22
  "openpgp": "^6.1.1",
23
23
  "papaparse": "^5.5.2",
24
- "passbolt-styleguide": "^5.14.7",
24
+ "passbolt-styleguide": "^5.15.0",
25
25
  "react": "^18.3.1",
26
26
  "react-dom": "^18.3.1",
27
- "secrets-passbolt": "github:passbolt/secrets.js#v2.0.1",
28
27
  "uuid": "^14.0.0",
29
28
  "validator": "^13.15.26",
30
29
  "webextension-polyfill": "^0.10.0",
@@ -76,10 +75,11 @@
76
75
  "webpack-cli": "^7.0.2"
77
76
  },
78
77
  "overrides": {
79
- "@xmldom/xmldom": "0.8.13",
78
+ "@xmldom/xmldom": "0.8.14",
80
79
  "uuid": "^14.0.0",
81
- "shell-quote": "1.8.4",
82
- "js-yaml": "^4.2.0"
80
+ "shell-quote": "1.10.0",
81
+ "js-yaml": "^4.2.0",
82
+ "adm-zip": "0.6.0"
83
83
  },
84
84
  "scripts": {
85
85
  "build": "webpack",
@@ -97,7 +97,7 @@
97
97
  "dev:watch:build:chromium-mv3": "npm run dev:build:chromium-mv3 -- -w",
98
98
  "dev:watch:build:safari": "npm run dev:build:safari -- -w",
99
99
  "lint": "npm run lint:lockfile && npm run lint:eslint",
100
- "lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts npm github.com --allowed-schemes \"https:\" \"git+ssh:\" --empty-hostname false --allowed-urls \"secrets-passbolt@2.0.1-ccce02543c135b0d92f69a70e960d634e7d64609@\"",
100
+ "lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts npm --allowed-schemes \"https:\" \"git+ssh:\" --empty-hostname false --allowed-urls \"git+ssh://git@github.com/passbolt/react-list.git#f2dc5551e8ec115b160538b4d9db51286e6d6f06\"",
101
101
  "lint:eslint": "eslint src --max-warnings 0",
102
102
  "lint:eslint-fix": "eslint --fix src",
103
103
  "test": "npm run test:unit",
@@ -95,11 +95,21 @@ class AppBootstrap extends Pagemod {
95
95
  * @returns {Promise<boolean>}
96
96
  */
97
97
  async assertUserAuthenticated() {
98
- const account = await GetActiveAccountService.get();
99
- const apiClientOptions = BuildApiClientOptionsService.buildFromAccount(account);
100
- const checkAuthStatusService = new CheckAuthStatusService(account, apiClientOptions);
101
- const authStatus = await checkAuthStatusService.checkAuthStatus(true);
102
- return authStatus.isAuthenticated;
98
+ let isAuthenticated = false;
99
+
100
+ try {
101
+ const account = await GetActiveAccountService.get();
102
+ const apiClientOptions = BuildApiClientOptionsService.buildFromAccount(account);
103
+ const checkAuthStatusService = new CheckAuthStatusService(account, apiClientOptions);
104
+
105
+ const authStatus = await checkAuthStatusService.checkAuthStatus(true);
106
+ isAuthenticated = authStatus.isAuthenticated;
107
+ } catch (error) {
108
+ // An error occured while checking the auth status
109
+ console.error(error);
110
+ }
111
+
112
+ return isAuthenticated;
103
113
  }
104
114
  }
105
115
 
@@ -24,6 +24,7 @@ import GetActiveAccountService from "../service/account/getActiveAccountService"
24
24
  import OnlineSessionEntity from "passbolt-styleguide/src/shared/models/entity/session/onlineSessionEntity";
25
25
  import AccountEntity from "../model/entity/account/accountEntity";
26
26
  import { defaultAccountDto } from "../model/entity/account/accountEntity.test.data";
27
+ import PassboltBadResponseError from "../error/passboltBadResponseError";
27
28
 
28
29
  const spyAddWorker = jest.spyOn(WorkersSessionStorage, "addWorker");
29
30
  jest.spyOn(ScriptExecution.prototype, "injectPortname").mockImplementation(jest.fn());
@@ -113,6 +114,22 @@ describe("AppBootstrap", () => {
113
114
  // expectations
114
115
  expect(constraint).toBeFalsy();
115
116
  });
117
+
118
+ it("Should not be able to attach a pagemod if the authentication status threw an error", async () => {
119
+ expect.assertions(1);
120
+
121
+ jest.spyOn(GetActiveAccountService, "get").mockImplementation(() => new AccountEntity(defaultAccountDto()));
122
+ // An API error occured
123
+ jest.spyOn(CheckAuthStatusService.prototype, "checkAuthStatus").mockRejectedValue(new PassboltBadResponseError());
124
+ jest.spyOn(UserSettings.prototype, "getDomain").mockImplementation(() => "https://passbolt.dev");
125
+
126
+ const result = await AppBootstrap.canBeAttachedTo({
127
+ frameId: Pagemod.TOP_FRAME_ID,
128
+ url: "https://passbolt.dev/app",
129
+ });
130
+
131
+ expect(result).toEqual(false);
132
+ });
116
133
  });
117
134
 
118
135
  describe("AppBootstrap::attachEvents", () => {
@@ -15,7 +15,7 @@
15
15
  import { OpenpgpAssertion } from "../../utils/openpgp/openpgpAssertions";
16
16
  import EncryptMessageService from "../crypto/encryptMessageService";
17
17
  import AccountRecoveryOrganizationPolicyEntity from "../../model/entity/accountRecovery/accountRecoveryOrganizationPolicyEntity";
18
- import secrets from "secrets-passbolt";
18
+ import CryptoRandomValuesService from "../crypto/cryptoRandomValuesService";
19
19
  import AccountRecoveryPrivateKeyPasswordEntity from "passbolt-styleguide/src/shared/models/entity/accountRecovery/accountRecoveryPrivateKeyPasswordEntity";
20
20
  import AccountRecoveryPrivateKeyPasswordDecryptedDataEntity from "../../model/entity/accountRecovery/accountRecoveryPrivateKeyPasswordDecryptedDataEntity";
21
21
  import AccountRecoveryUserSettingEntity from "passbolt-styleguide/src/shared/models/entity/accountRecovery/accountRecoveryUserSettingEntity";
@@ -39,7 +39,7 @@ class BuildApprovedAccountRecoveryUserSettingEntityService {
39
39
  throw new Error("The provided organizationPolicy must be a valid AccountRecoveryOrganizationPolicyEntity.");
40
40
  }
41
41
 
42
- const symmetricSecret = secrets.random(SYMMETRIC_SECRET_BITS);
42
+ const symmetricSecret = CryptoRandomValuesService.randomHex(SYMMETRIC_SECRET_BITS);
43
43
  const accountRecoveryPrivateKeyDto = await this._encryptPrivateKey(symmetricSecret, decryptedPrivateKey);
44
44
  const accountRecoveryPrivateKeyPasswordForOrganizationDto =
45
45
  await this._encryptPrivateKeyPasswordsForOrganizationKey(
@@ -55,8 +55,19 @@ class StartLoopAuthSessionCheckService {
55
55
  const account = await GetActiveAccountService.get();
56
56
  const apiClientOptions = BuildApiClientOptionsService.buildFromAccount(account);
57
57
  const checkAuthService = new CheckAuthStatusService(account, apiClientOptions);
58
- const authStatus = await checkAuthService.checkAuthStatus(true);
59
- if (!authStatus.isAuthenticated) {
58
+
59
+ let isAuthenticated = false;
60
+
61
+ try {
62
+ const authStatus = await checkAuthService.checkAuthStatus(true);
63
+ isAuthenticated = authStatus.isAuthenticated;
64
+ } catch (error) {
65
+ // An error occured while checking the auth status
66
+ console.error(error);
67
+ return;
68
+ }
69
+
70
+ if (!isAuthenticated) {
60
71
  PostLogoutService.exec();
61
72
  }
62
73
  }
@@ -18,6 +18,7 @@ import AccountEntity from "../../model/entity/account/accountEntity";
18
18
  import { defaultAccountDto } from "../../model/entity/account/accountEntity.test.data";
19
19
  import GetActiveAccountService from "../account/getActiveAccountService";
20
20
  import OnlineSessionEntity from "passbolt-styleguide/src/shared/models/entity/session/onlineSessionEntity";
21
+ import PassboltBadResponseError from "../../error/passboltBadResponseError";
21
22
 
22
23
  jest.useFakeTimers();
23
24
 
@@ -91,4 +92,31 @@ describe("StartLoopAuthSessionCheckService", () => {
91
92
  expect(spyIsAuthenticated).toHaveBeenCalledTimes(1);
92
93
  expect(spyOnPostLogout).toHaveBeenCalledTimes(1);
93
94
  });
95
+
96
+ it("should not send logout event if the authentication status cannot be determined, and retry on the next alarm", async () => {
97
+ expect.assertions(4);
98
+
99
+ const spyIsAuthenticated = jest
100
+ .spyOn(CheckAuthStatusService.prototype, "checkAuthStatus")
101
+ .mockRejectedValue(new PassboltBadResponseError());
102
+ const spyOnPostLogout = jest.spyOn(PostLogoutService, "exec").mockImplementation(async () => {});
103
+
104
+ browser.alarms.onAlarm.addListener(
105
+ async (alarm) => await StartLoopAuthSessionCheckService.handleAuthStatusCheckAlarm(alarm),
106
+ );
107
+
108
+ await StartLoopAuthSessionCheckService.exec();
109
+
110
+ await jest.advanceTimersByTime(60000);
111
+ await Promise.resolve();
112
+
113
+ expect(spyIsAuthenticated).toHaveBeenCalledTimes(1);
114
+ expect(spyOnPostLogout).not.toHaveBeenCalled();
115
+
116
+ await jest.advanceTimersByTime(60000);
117
+ await Promise.resolve();
118
+
119
+ expect(spyIsAuthenticated).toHaveBeenCalledTimes(2);
120
+ expect(spyOnPostLogout).not.toHaveBeenCalled();
121
+ });
94
122
  });
@@ -31,6 +31,9 @@ class AuthenticationStatusService extends AbstractService {
31
31
  /**
32
32
  * Check if the current user is authenticated.
33
33
  * @returns {Promise<boolean>}
34
+ * @throws {PassboltBadResponseError} If the response can't be parsed
35
+ * @throws {MfaAuthenticationRequiredError} If there was an error during the MFA
36
+ * @throws {NotFoundError} If the server answered with 404
34
37
  */
35
38
  async isAuthenticated() {
36
39
  const url = this.apiClient.buildUrl(`${this.apiClient.baseUrl.toString()}/is-authenticated`, null);
@@ -17,6 +17,7 @@ import { mockApiResponse, mockApiResponseError, mockApiRedirectResponse } from "
17
17
  import NotFoundError from "../error/notFoundError";
18
18
  import { defaultApiClientOptions } from "passbolt-styleguide/src/shared/lib/apiClient/apiClientOptions.test.data";
19
19
  import MfaAuthenticationRequiredError from "../error/mfaAuthenticationRequiredError";
20
+ import PassboltBadResponseError from "../error/passboltBadResponseError";
20
21
 
21
22
  beforeAll(() => {
22
23
  enableFetchMocks();
@@ -58,4 +59,13 @@ describe("AuthenticationStatusService::isAuthenticated", () => {
58
59
  const authenticationStatusService = new AuthenticationStatusService(defaultApiClientOptions());
59
60
  await expect(authenticationStatusService.isAuthenticated()).rejects.toThrow(MfaAuthenticationRequiredError);
60
61
  });
62
+
63
+ it("should throw a PassboltBadResponseError if the response can't be parsed (e.g HTML error page, ...)", async () => {
64
+ expect.assertions(1);
65
+
66
+ mockIsAuthenticated(async () => "<html><body>502 Bad Gateway</body></html>");
67
+ const authenticationStatusService = new AuthenticationStatusService(defaultApiClientOptions());
68
+
69
+ await expect(authenticationStatusService.isAuthenticated()).rejects.toThrow(PassboltBadResponseError);
70
+ });
61
71
  });
@@ -24,6 +24,25 @@ class CryptoRandomValuesService {
24
24
  self.crypto.getRandomValues(buf);
25
25
  return buf;
26
26
  }
27
+
28
+ /**
29
+ * Generate a random bits-length number as a hexadecimal string
30
+ *
31
+ * @param bits {number} The number of random bits to generate, an integer multiple of 8 between 8 and 65536.
32
+ * @returns {string} A non-zero hexadecimal string of bits/4 characters, leading zeros preserved.
33
+ * @throws {Error} If bits is not an integer multiple of 8 between 8 and 65536.
34
+ */
35
+ static randomHex(bits) {
36
+ if (!Number.isInteger(bits) || bits % 8 !== 0 || bits < 8 || bits > 65536) {
37
+ throw new Error("Number of bits must be an integer multiple of 8 between 8 and 65536.");
38
+ }
39
+
40
+ let bytes;
41
+ do {
42
+ bytes = this.randomValuesArray(bits / 8);
43
+ } while (!bytes.some((byte) => byte !== 0)); // an all-zero secret is rejected
44
+ return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
45
+ }
27
46
  }
28
47
 
29
48
  export default CryptoRandomValuesService;
@@ -20,4 +20,26 @@ describe("RandomValue service", () => {
20
20
  const value = CryptoRandomValuesService.randomValuesArray(32);
21
21
  expect(value.length).toEqual(32);
22
22
  });
23
+
24
+ describe("::randomHex", () => {
25
+ it("should generate a non-zero hexadecimal string of the requested bits length", () => {
26
+ expect.assertions(3);
27
+ const hex = CryptoRandomValuesService.randomHex(512);
28
+ expect(hex).toHaveLength(128);
29
+ expect(hex).toMatch(/^[0-9a-f]+$/);
30
+ expect(hex).toMatch(/[^0]/);
31
+ });
32
+
33
+ it("should throw if bits is not an integer multiple of 8 between 8 and 65536", () => {
34
+ expect.assertions(7);
35
+ const expectedError = new Error("Number of bits must be an integer multiple of 8 between 8 and 65536.");
36
+ expect(() => CryptoRandomValuesService.randomHex("512")).toThrow(expectedError);
37
+ expect(() => CryptoRandomValuesService.randomHex(512.5)).toThrow(expectedError);
38
+ expect(() => CryptoRandomValuesService.randomHex(9)).toThrow(expectedError);
39
+ expect(() => CryptoRandomValuesService.randomHex(510)).toThrow(expectedError);
40
+ expect(() => CryptoRandomValuesService.randomHex(0)).toThrow(expectedError);
41
+ expect(() => CryptoRandomValuesService.randomHex(65544)).toThrow(expectedError);
42
+ expect(() => CryptoRandomValuesService.randomHex()).toThrow(expectedError);
43
+ });
44
+ });
23
45
  });
@@ -60,10 +60,16 @@ export default class FindAndUpdateSiteSettingsLocalStorageService {
60
60
 
61
61
  // Authenticated sessions persist to SiteSettingsLocalStorage (the offline-mode store);
62
62
  // Anonymous sessions only get the in-memory runtime cache below.
63
- const activeSession = await this.checkAuthStatusService.checkAuthStatus();
64
- if (activeSession.isAuthenticated) {
65
- await this.siteSettingsLocalStorage.set(siteSettings);
63
+ try {
64
+ const activeSession = await this.checkAuthStatusService.checkAuthStatus();
65
+ if (activeSession.isAuthenticated) {
66
+ await this.siteSettingsLocalStorage.set(siteSettings);
67
+ }
68
+ } catch (error) {
69
+ // An error occured while checking the auth status
70
+ console.error(error);
66
71
  }
72
+
67
73
  /*
68
74
  * PB-53134:
69
75
  * Set a cache of site setting without account id as a key to get the cache in AppEmailValidatorService
@@ -20,6 +20,7 @@ import SiteSettingsLocalStorage from "../local_storage/siteSettingsLocalStorage"
20
20
  import SiteSettingsRuntimeCache from "./siteSettingsRuntimeCache";
21
21
  import FindAndUpdateSiteSettingsLocalStorageService from "./findAndUpdateSiteSettingsLocalStorageService";
22
22
  import OnlineSessionEntity from "passbolt-styleguide/src/shared/models/entity/session/onlineSessionEntity";
23
+ import PassboltBadResponseError from "../../error/passboltBadResponseError";
23
24
 
24
25
  const readBrowserStorage = async (storageKey) => {
25
26
  const data = await browser.storage.local.get([storageKey]);
@@ -87,6 +88,23 @@ describe("FindAndUpdateSiteSettingsLocalStorageService", () => {
87
88
  expect(await readBrowserStorage(service.siteSettingsLocalStorage.storageKey)).toBeUndefined();
88
89
  expect(SiteSettingsLocalStorage._runtimeCachedData[account.id]).toBeUndefined();
89
90
  });
91
+
92
+ it("should handle API errors as if the user is not authenticated", async () => {
93
+ expect.assertions(4);
94
+
95
+ const dto = defaultProSiteSettings();
96
+
97
+ // An API error occured
98
+ jest.spyOn(service.checkAuthStatusService, "checkAuthStatus").mockRejectedValue(new PassboltBadResponseError());
99
+ jest.spyOn(service.findSiteSettingsService, "findSiteSettings").mockResolvedValue(new SiteSettingsEntity(dto));
100
+
101
+ const result = await service.findAndUpdateAll();
102
+
103
+ expect(result.toDto()).toEqual(dto);
104
+ expect(SiteSettingsRuntimeCache.get()).toEqual(dto);
105
+ expect(await readBrowserStorage(service.siteSettingsLocalStorage.storageKey)).toBeUndefined();
106
+ expect(SiteSettingsLocalStorage._runtimeCachedData[account.id]).toBeUndefined();
107
+ });
90
108
  });
91
109
 
92
110
  describe("::findAndUpdateAll — concurrency", () => {
@@ -54,9 +54,17 @@ export default class GetOrFindSiteSettingsService {
54
54
  */
55
55
  async getOrFind(refreshCache = true) {
56
56
  if (!refreshCache) {
57
- const activeSession = await this.checkAuthStatusService.checkAuthStatus();
57
+ let isAuthenticated = false;
58
58
 
59
- if (activeSession.isAuthenticated) {
59
+ try {
60
+ const activeSession = await this.checkAuthStatusService.checkAuthStatus();
61
+ isAuthenticated = activeSession.isAuthenticated;
62
+ } catch (error) {
63
+ // An error occured while checking the auth status
64
+ console.error(error);
65
+ }
66
+
67
+ if (isAuthenticated) {
60
68
  const lsDto = await this.siteSettingsLocalStorage.get();
61
69
  if (lsDto) {
62
70
  const siteSettings = new SiteSettingsEntity(lsDto);
@@ -21,6 +21,7 @@ import SiteSettingsRuntimeCache from "./siteSettingsRuntimeCache";
21
21
  import GetOrFindSiteSettingsService from "./getOrFindSiteSettingsService";
22
22
  import OnlineSessionEntity from "passbolt-styleguide/src/shared/models/entity/session/onlineSessionEntity";
23
23
  import CheckAuthStatusService from "../auth/checkAuthStatusService";
24
+ import PassboltBadResponseError from "../../error/passboltBadResponseError";
24
25
 
25
26
  beforeEach(() => {
26
27
  jest.clearAllMocks();
@@ -172,4 +173,45 @@ describe("GetOrFindSiteSettingsService", () => {
172
173
  expect(result.toDto()).toEqual(dto);
173
174
  });
174
175
  });
176
+
177
+ describe("::getOrFind (refreshCache=false) — authentication status unavailable", () => {
178
+ beforeEach(() => {
179
+ // An API error occured
180
+ jest.spyOn(CheckAuthStatusService.prototype, "checkAuthStatus").mockRejectedValue(new PassboltBadResponseError());
181
+ });
182
+
183
+ it("should return the runtime cache when populated when there is an API error", async () => {
184
+ expect.assertions(3);
185
+
186
+ const dto = defaultProSiteSettings();
187
+ SiteSettingsRuntimeCache.set(new SiteSettingsEntity(dto));
188
+
189
+ const localStorageSpy = jest.spyOn(service.siteSettingsLocalStorage, "get");
190
+ const apiSpy = jest.spyOn(
191
+ service.findAndUpdateSiteSettingsLocalStorageService.findSiteSettingsService,
192
+ "findSiteSettings",
193
+ );
194
+
195
+ const result = await service.getOrFind(false);
196
+
197
+ expect(result.toDto()).toEqual(dto);
198
+ expect(localStorageSpy).not.toHaveBeenCalled();
199
+ expect(apiSpy).not.toHaveBeenCalled();
200
+ });
201
+
202
+ it("should call the API when cache is empty when there is an API error", async () => {
203
+ expect.assertions(2);
204
+
205
+ const dto = defaultProSiteSettings();
206
+
207
+ const apiSpy = jest
208
+ .spyOn(service.findAndUpdateSiteSettingsLocalStorageService.findSiteSettingsService, "findSiteSettings")
209
+ .mockResolvedValue(new SiteSettingsEntity(dto));
210
+
211
+ const result = await service.getOrFind(false);
212
+
213
+ expect(apiSpy).toHaveBeenCalledTimes(1);
214
+ expect(result.toDto()).toEqual(dto);
215
+ });
216
+ });
175
217
  });
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 2,
3
3
  "name": "__MSG_appName__",
4
4
  "short_name": "passbolt",
5
- "version": "5.14.3",
5
+ "version": "5.15.0",
6
6
  "description": "__MSG_appDescription__",
7
7
  "default_locale": "en",
8
8
  "externally_connectable": {},
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 3,
3
3
  "name": "__MSG_appName__",
4
4
  "short_name": "passbolt",
5
- "version": "5.14.3",
5
+ "version": "5.15.0",
6
6
  "description": "__MSG_appDescription__",
7
7
  "default_locale": "en",
8
8
  "minimum_chrome_version": "116",
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 2,
3
3
  "name": "__MSG_appName__",
4
4
  "short_name": "passbolt",
5
- "version": "5.14.3",
5
+ "version": "5.15.0",
6
6
  "description": "__MSG_appDescription__",
7
7
  "default_locale": "en",
8
8
  "browser_specific_settings": {
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 2,
3
3
  "name": "Passbolt - password manager",
4
4
  "short_name": "passbolt",
5
- "version": "5.14.3",
5
+ "version": "5.15.0",
6
6
  "description": "Passbolt extension for the open source password manager.",
7
7
  "default_locale": "en",
8
8
  "icons": {
@@ -14,27 +14,26 @@
14
14
  const path = require("path");
15
15
  const webpack = require("webpack");
16
16
 
17
- const PASSBOLT_ENV_KEYS = ["PASSBOLT_DEBUG", "PASSBOLT_LOG_LEVEL", "PASSBOLT_LOG_CONSOLE"];
18
-
19
- // Defaults applied when the corresponding process.env entry is unset. They mirror
20
- // the legacy config.json.debug values so `NODE_ENV=development` builds get the
21
- // dev-friendly configuration without any host configuration.
17
+ // Defaults applied when the corresponding process.env entry is unset.
18
+ // We use 'no debug' values by default and only enable them when we are in development mode.
22
19
  const DEBUG_DEFAULTS = {
23
- PASSBOLT_DEBUG: "true",
24
- PASSBOLT_LOG_LEVEL: "4",
25
- PASSBOLT_LOG_CONSOLE: "true",
20
+ PASSBOLT_DEBUG: "false",
21
+ PASSBOLT_LOG_LEVEL: "0",
22
+ PASSBOLT_LOG_CONSOLE: "false",
26
23
  };
27
24
 
25
+ const PASSBOLT_ENV_KEYS = Object.keys(DEBUG_DEFAULTS);
26
+
28
27
  module.exports = function buildPassboltEnvPlugin() {
29
28
  const isDevelopment = process.env.NODE_ENV === "development";
30
29
 
31
30
  if (isDevelopment) {
31
+ require("dotenv").config({ path: path.resolve(__dirname, "..", ".env") });
32
+ } else {
32
33
  // Strip any inherited shell value so EnvironmentPlugin falls back to defaults.
33
34
  for (const key of PASSBOLT_ENV_KEYS) {
34
35
  delete process.env[key];
35
36
  }
36
- } else {
37
- require("dotenv").config({ path: path.resolve(__dirname, "..", ".env") });
38
37
  }
39
38
 
40
39
  return new webpack.EnvironmentPlugin(DEBUG_DEFAULTS);