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

build: FORMS-1768 update happy-dom to fix vulnerability #1612

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

WalterMoar
Copy link
Collaborator

Description

The GitHub Dependabot process has created an alert for the happy-dom dependency. To satisfy the requirements outlined in the Security Threat and Risk Assessment's (STRA) Statement of Acceptable Risks (SoAR), this vulnerability must be handled by updating the package version (or mitigated in some other way, if updating the package is not possible).
https://github.com/bcgov/common-hosted-form-service/security/dependabot/211

Type of Change

build (change in build system or dependencies)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have run the npm script lint on the frontend and backend
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have approval from the product owner for the contribution in this pull request

Further comments

Note: also fixed a warning that the test config file format is using a deprecated element structure.

// This needs to be implemented
// TODO: This needs to be implemented
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO here to highlight the technical debt in Sonar.

Comment on lines -117 to -119
const mockInputElement = document.createElement('input');
mockInputElement.type = 'file';
const file = await readFile(mockInputElement);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing because readFile doesn't take a DOM element as input. Not sure how it ever passed.

Copy link

Comment on lines +500 to +502
windowOpenSpy.mockReset();
appendChildSpy.mockReset();
addNotificationSpy.mockReset();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something in the mount was calling these spies. Since we're not testing the mount, they should be cleared afterwards (tests were failing)

@WalterMoar WalterMoar force-pushed the build/1768-happy-dom-vuln branch from 9d99661 to 4f9d12d Compare February 21, 2025 00:19
Copy link

@WalterMoar WalterMoar changed the title build: FROMS-1768 update happy-dom to fix vulnerability build: FORMS-1768 update happy-dom to fix vulnerability Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant