diff --git a/Jenkinsfile_CNP b/Jenkinsfile_CNP index 8c8777f37..952823762 100644 --- a/Jenkinsfile_CNP +++ b/Jenkinsfile_CNP @@ -191,5 +191,5 @@ withPipeline(type, product, component) { reportName : 'AAT Functional Test' ]) } - + } diff --git a/Jenkinsfile_nightly b/Jenkinsfile_nightly index 5262fe28b..2dff591a0 100644 --- a/Jenkinsfile_nightly +++ b/Jenkinsfile_nightly @@ -20,10 +20,14 @@ def channel = '#xui-pipeline' def secrets = [ 'rpx-${env}': [ - secret('test-email', 'TEST_EMAIL'), - secret('test-password', 'TEST_PASSWORD'), + secret('test-user1-email', 'TEST_USER1_EMAIL'), + secret('test-user1-password', 'TEST_USER1_PASSWORD'), + secret('test-user2-email', 'TEST_USER2_EMAIL'), + secret('test-user2-password', 'TEST_USER2_PASSWORD'), + secret('test-townley-email', 'TEST_TOWNLEY_EMAIL'), + secret('test-townley-password', 'TEST_TOWNLEY_PASSWORD'), secret('test-api-email', 'TEST_API_EMAIL'), - secret('test-api-password', 'TEST_API_PASSWORD'), + secret('test-api-password', 'TEST_API_PASSWORD') ], ] @@ -40,7 +44,7 @@ withNightlyPipeline(type, product, component) { enableSlackNotifications(channel) loadVaultSecrets(secrets) // enableFortifyScan('rpx-aat') - // enableFullFunctionalTest(60) + //enableFullFunctionalTest(120) // enableSecurityScan() enableMutationTest() enableCrossBrowserTest() @@ -124,5 +128,6 @@ withNightlyPipeline(type, product, component) { reportFiles : 'index.html', reportName : 'XUI Manage Organisation Cross Browser Tests' ]) + steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/tests/crossbrowser/**/*' } } diff --git a/package.json b/package.json index 4cc5ee023..cbe17b4b4 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,8 @@ "@angular/platform-browser-dynamic": "^17.3.6", "@angular/router": "^17.3.6", "@circlon/angular-tree-component": "^11.0.4", + "@cucumber/cucumber": "^11.0.0", + "@cucumber/pretty-formatter": "^1.0.1", "@edium/fsm": "^2.1.2", "@hmcts/ccd-case-ui-toolkit": "7.0.40", "@hmcts/ccpay-web-component": "6.2.1", diff --git a/test/e2e/config/common.conf.js b/test/e2e/config/common.conf.js index 97ee9655f..439217b13 100644 --- a/test/e2e/config/common.conf.js +++ b/test/e2e/config/common.conf.js @@ -27,7 +27,13 @@ const localConfig = [ const config = { config: { - baseUrl: process.env.TEST_URL || 'http://localhost:3000/' + baseUrl: process.env.TEST_URL || 'http://localhost:3000/', + username: process.env.TEST_USER1_EMAIL, + password: process.env.TEST_USER1_PASSWORD, + username_rw: process.env.TEST_USER2_EMAIL, + password_rw: process.env.TEST_USER2_PASSWORD, + townleyUser: process.env.TEST_TOWNLEY_EMAIL, + townleyPassword: process.env.TEST_TOWNLEY_PASSWORD }, twoFactorAuthEnabled: false, termsAndConditionsEnabled: true diff --git a/test/e2e/config/crossbrowser.conf.js b/test/e2e/config/crossbrowser.conf.js index 45bdc67a3..c22167c85 100644 --- a/test/e2e/config/crossbrowser.conf.js +++ b/test/e2e/config/crossbrowser.conf.js @@ -3,7 +3,7 @@ const chaiAsPromised = require('chai-as-promised'); chai.use(chaiAsPromised); const minimist = require('minimist'); const argv = minimist(process.argv.slice(2)); - +const cucumberPretty = require('@cucumber/pretty-formatter'); const config = { framework: 'custom', frameworkPath: require.resolve('protractor-cucumber-framework'), @@ -17,12 +17,16 @@ const config = { specs: ['../features/**/*.feature'], baseUrl: (process.env.TEST_URL || 'http://localhost:3000/').replace('https', 'http'), - + params: { serverUrls: process.env.TEST_URL || 'http://localhost:3000/', - targetEnv: argv.env || 'local' - //username: process.env.TEST_EMAIL, - //password: process.env.TEST_PASSWORD, + targetEnv: argv.env || 'local', + username: process.env.TEST_USER1_EMAIL, + password: process.env.TEST_USER1_PASSWORD, + username_rw: process.env.TEST_USER2_EMAIL, + password_rw: process.env.TEST_USER2_PASSWORD, + townleyUser: process.env.TEST_TOWNLEY_EMAIL, + townleyPassword: process.env.TEST_TOWNLEY_PASSWORD }, // sauceProxy: 'http://proxyout.reform.hmcts.net:8080', // Proxy for the REST API @@ -115,9 +119,9 @@ const config = { cucumberOpts: { strict: true, - format: ['node_modules/cucumber-pretty', 'json:cb_reports/saucelab_results.json'], - require: ['../support/world.js', '../support/*.js', '../features/step_definitions/**/*.steps.js'], - tags: ['@crossbrowser', 'not @Flaky'] + format: ['@cucumber/pretty-formatter', 'json:cb_reports/saucelab_results.json'], + require: ['../support/timeout.js', '../features/step_definitions/**/*.steps.js'], + tags: ['@crossbrowser'] }, plugins: [ diff --git a/test/e2e/config/fullfunctional.conf.js b/test/e2e/config/fullfunctional.conf.js index f5fa0e8e2..480bcf828 100644 --- a/test/e2e/config/fullfunctional.conf.js +++ b/test/e2e/config/fullfunctional.conf.js @@ -37,7 +37,7 @@ const config = { cucumberOpts: { strict: true, // format: ['node_modules/cucumber-pretty'], - format: ['node_modules/cucumber-pretty', 'json:reports/tests/functional/results.json'], + format: ['@cucumber/pretty-formatter', 'json:reports/tests/functional/results.json'], tags: ['@all or @smoke or @fullFunctional or @end2end', 'not @Flaky'], // tags: ['@edit'], require: cucumberOpts diff --git a/test/e2e/config/functional.conf.js b/test/e2e/config/functional.conf.js index dae026ce7..05ee96e9f 100644 --- a/test/e2e/config/functional.conf.js +++ b/test/e2e/config/functional.conf.js @@ -37,7 +37,7 @@ const config = { cucumberOpts: { strict: true, - format: ['node_modules/cucumber-pretty', 'json:reports_json/results.json'], + format: ['@cucumber/pretty-formatter', 'json:reports_json/results.json'], tags: ['@all or @fullFunctional', 'not @Flaky'], // tags: ['@all or @smoke or @fullFunctional or @end2end'], require: cucumberOpts diff --git a/test/e2e/config/smoke.conf.js b/test/e2e/config/smoke.conf.js index 204a94530..d5512ff4b 100644 --- a/test/e2e/config/smoke.conf.js +++ b/test/e2e/config/smoke.conf.js @@ -89,7 +89,7 @@ const config = { cucumberOpts: { strict: true, // format: ['node_modules/cucumber-pretty'], - format: ['node_modules/cucumber-pretty', 'json:reports_json/results.json'], + format: ['@cucumber/pretty-formatter', 'json:reports_json/results.json'], tags: ['@smoke', 'not @Flaky'], require: [ '../support/timeout.js', diff --git a/test/e2e/features/app/loginLogout.feature b/test/e2e/features/app/loginLogout.feature index d482b5d35..a20ba4be1 100644 --- a/test/e2e/features/app/loginLogout.feature +++ b/test/e2e/features/app/loginLogout.feature @@ -25,9 +25,9 @@ Feature: Login Then I should be redirected to the Idam login page Then I should see failure error summary - + @crossbrowser Scenario: login and log out from manage organisation as ManageOrg user - Given I am logged into manage organisation with ManageOrg user details + Given I am logged into Townley Services Org Then I should be redirected to manage organisation dashboard page When I select the sign out link Then I should be redirected to the Idam login page diff --git a/test/e2e/features/app/viewOrganisation.feature b/test/e2e/features/app/viewOrganisation.feature index 2009a3dcb..33eed18b1 100644 --- a/test/e2e/features/app/viewOrganisation.feature +++ b/test/e2e/features/app/viewOrganisation.feature @@ -1,8 +1,7 @@ -@crossbrowser Feature: view organisation workflow @Flaky Scenario: view organisation workflow When I navigate to manage organisation Url - Given I am logged into manage organisation with ManageOrg user details + Given I am logged into Townley Services Org Then I should be redirected to manage organisation dashboard page Then I should be on display the name and address details of organisation diff --git a/test/e2e/features/pageObjects/loginLogoutObjects.js b/test/e2e/features/pageObjects/loginLogoutObjects.js index 16c004a75..2fbd356c2 100644 --- a/test/e2e/features/pageObjects/loginLogoutObjects.js +++ b/test/e2e/features/pageObjects/loginLogoutObjects.js @@ -3,7 +3,7 @@ const { SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); function loginLogoutObjects() { - this.emailAddress = element(by.css('input#username')); + this.emailAddress = element(by.css('[id=\'username\']')); this.password = element(by.css('[id=\'password\']')); this.signinTitle= element(by.xpath('//h1[@class=\'heading-large\']')); //this.signinTitle = element(by.css("h1")); diff --git a/test/e2e/features/step_definitions/acceptTermsAndConditions.steps.js b/test/e2e/features/step_definitions/acceptTermsAndConditions.steps.js index c5f6f2b50..15d943b3c 100644 --- a/test/e2e/features/step_definitions/acceptTermsAndConditions.steps.js +++ b/test/e2e/features/step_definitions/acceptTermsAndConditions.steps.js @@ -1,3 +1,4 @@ +const { Then, When } = require('@cucumber/cucumber'); const acceptTermsAndConditionsPage = require('../pageObjects/termsAndConditionsConfirmPage'); const HeaderPage = require('../pageObjects/headerPage'); @@ -5,30 +6,27 @@ const HeaderPage = require('../pageObjects/headerPage'); const { config } = require('../../config/common.conf'); const browserWaits = require('../../support/customWaits'); -const { defineSupportCode } = require('cucumber'); -defineSupportCode(function ({ And, But, Given, Then, When }) { - const headerPage = new HeaderPage(); - Then('I am on Accept Terms and Conditions page', async function () { - const world = this; - if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()){ - await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); - expect(await acceptTermsAndConditionsPage.amOnPage()).to.be.true; - } else { - world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js. Validating Home page displayed'); - await headerPage.waitForPrimaryNavigationToDisplay(); - } - }); +const headerPage = new HeaderPage(); +Then('I am on Accept Terms and Conditions page', async function () { + const world = this; + if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()){ + await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); + expect(await acceptTermsAndConditionsPage.amOnPage()).to.be.true; + } else { + world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js. Validating Home page displayed'); + await headerPage.waitForPrimaryNavigationToDisplay(); + } +}); - When('I click Confirm in Accept Terms and Conditions page', async function () { - const world = this; - if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()) { - await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); - await acceptTermsAndConditionsPage.acceptTremsAndConditions(); - await headerPage.waitForPrimaryNavigationToDisplay(); - } else { - world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js.Validating Home page displayed'); - await headerPage.waitForPrimaryNavigationToDisplay(); - } - }); +When('I click Confirm in Accept Terms and Conditions page', async function () { + const world = this; + if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()) { + await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); + await acceptTermsAndConditionsPage.acceptTremsAndConditions(); + await headerPage.waitForPrimaryNavigationToDisplay(); + } else { + world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js.Validating Home page displayed'); + await headerPage.waitForPrimaryNavigationToDisplay(); + } }); diff --git a/test/e2e/features/step_definitions/approveOrg.steps.js b/test/e2e/features/step_definitions/approveOrg.steps.js index 9f8b4b7ca..87a0d8eb9 100644 --- a/test/e2e/features/step_definitions/approveOrg.steps.js +++ b/test/e2e/features/step_definitions/approveOrg.steps.js @@ -1,24 +1,21 @@ +const { When } = require('@cucumber/cucumber'); const approveOrganizationService = require('../pageObjects/approveOrganizationService'); const mailinatorService = require('../pageObjects/mailinatorService'); -const { defineSupportCode } = require('cucumber'); +When('I approve organisation', { timeout: 300*1000 }, async function () { + await approveOrganizationService.init(); + await approveOrganizationService.approveOrg(global.latestOrgCreated); + await approveOrganizationService.destroy(); +},); -defineSupportCode(function ({ And, But, Given, Then, When }) { - When('I approve organisation', { timeout: 300*1000 }, async function () { - await approveOrganizationService.init(); - await approveOrganizationService.approveOrg(global.latestOrgCreated); - await approveOrganizationService.destroy(); - },); - - When('I activate approved organisation super user', { timeout: 600 * 1000 }, async function () { - await mailinatorService.init(); - mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - await mailinatorService.openRegistrationEmailForUser(global.latestOrgSuperUser); - await mailinatorService.completeUserRegistrationFromEmail(); - await mailinatorService.destroy(); - }); +When('I activate approved organisation super user', { timeout: 600 * 1000 }, async function () { + await mailinatorService.init(); + mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + await mailinatorService.openRegistrationEmailForUser(global.latestOrgSuperUser); + await mailinatorService.completeUserRegistrationFromEmail(); + await mailinatorService.destroy(); }); function logger(world, message, isScreenshot) { diff --git a/test/e2e/features/step_definitions/createOrganisation.steps.js b/test/e2e/features/step_definitions/createOrganisation.steps.js index d453ea1ea..7de0af8ab 100644 --- a/test/e2e/features/step_definitions/createOrganisation.steps.js +++ b/test/e2e/features/step_definitions/createOrganisation.steps.js @@ -1,7 +1,8 @@ 'use strict'; +const { Then, When } = require('@cucumber/cucumber'); const CreateOrganisationObjects = require('../pageObjects/createOrganisationObjects'); -const { defineSupportCode } = require('cucumber'); + const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); const { config } = require('../../config/common.conf.js'); const approveOrganizationService = require('../pageObjects/approveOrganizationService'); @@ -16,279 +17,277 @@ async function waitForElement(el) { }, 600000); } -defineSupportCode(function ({ Given, When, Then }) { - const createOrganisationObject = new CreateOrganisationObjects(); +const createOrganisationObject = new CreateOrganisationObjects(); - When(/^I navigate to EUI Manage Organisation Url$/, async function () { - await browser.driver.manage().deleteAllCookies(); - await browser.get(config.config.baseUrl + '/register-org/register'); - browser.sleep(MID_DELAY); - }); +When(/^I navigate to EUI Manage Organisation Url$/, async function () { + await browser.driver.manage().deleteAllCookies(); + await browser.get(config.config.baseUrl + '/register-org/register'); + browser.sleep(MID_DELAY); +}); - When(/^I navigate to EUI Register Organisation Url$/, async function () { - await browser.driver.manage().deleteAllCookies(); - await browser.get(config.config.baseUrl + '/register-org/register'); - browser.sleep(MID_DELAY); - }); +When(/^I navigate to EUI Register Organisation Url$/, async function () { + await browser.driver.manage().deleteAllCookies(); + await browser.get(config.config.baseUrl + '/register-org/register'); + browser.sleep(MID_DELAY); +}); - Then('I am on Register organisation start page', async function () { - await createOrganisationObject.waitForStartRegisterPage(); - await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; - await expect(createOrganisationObject.start_button.getText(), 'Start button text not mathing with expected') - .to - .eventually - .equal('Start'); - }); +Then('I am on Register organisation start page', async function () { + await createOrganisationObject.waitForStartRegisterPage(); + await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; + await expect(createOrganisationObject.start_button.getText(), 'Start button text not mathing with expected') + .to + .eventually + .equal('Start'); +}); - Then(/^I land on register organisation page and continue$/, { timeout: 600 * 1000 }, async function () { - // await waitForElement('govuk-heading-xl'); +Then(/^I land on register organisation page and continue$/, { timeout: 600 * 1000 }, async function () { + // await waitForElement('govuk-heading-xl'); - await BrowserWaits.retryWithActionCallback(async () => { + await BrowserWaits.retryWithActionCallback(async () => { + browser.sleep(LONG_DELAY); + try { browser.sleep(LONG_DELAY); - try { - browser.sleep(LONG_DELAY); - - await BrowserWaits.retryWithActionCallback(async () => { - await BrowserWaits.waitForElement($('.govuk-heading-xl')); - }); - - await waitForElement('govuk-heading-xl', LONG_DELAY); - await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; - await expect(createOrganisationObject.start_button.getText()) - .to - .eventually - .equal('Start'); - await createOrganisationObject.start_button.click(); - } catch (err){ - await browser.get(config.config.baseUrl + '/register-org/register'); - throw new Error(err); - } - }); - }); - Then(/^I Enter the Organization name$/, { timeout: 600 * 1000 }, async function () { - // await waitForElement('govuk-heading-xl'); - await expect(createOrganisationObject.org_name.isDisplayed(), 'Input Organisation name nor present').to.eventually.be.true; - await createOrganisationObject.enterOrgName(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); + await BrowserWaits.retryWithActionCallback(async () => { + await BrowserWaits.waitForElement($('.govuk-heading-xl')); + }); + + await waitForElement('govuk-heading-xl', LONG_DELAY); + await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; + await expect(createOrganisationObject.start_button.getText()) + .to + .eventually + .equal('Start'); + await createOrganisationObject.start_button.click(); + } catch (err){ + await browser.get(config.config.baseUrl + '/register-org/register'); + throw new Error(err); + } }); +}); - Then(/^I Enter the Office Address details$/, { timeout: 600 * 1000 }, async function () { - // await waitForElement(createOrganisationObject.officeAddressOne); - await expect(createOrganisationObject.officeAddressOne.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.officeAddressOne.sendKeys('1, Cliffinton'); - // browser.sleep(MID_DELAY); - await expect(createOrganisationObject.townName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.townName.sendKeys('London'); - await expect(createOrganisationObject.postcode.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.postcode.sendKeys('SE15TY'); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); +Then(/^I Enter the Organization name$/, { timeout: 600 * 1000 }, async function () { + // await waitForElement('govuk-heading-xl'); + await expect(createOrganisationObject.org_name.isDisplayed(), 'Input Organisation name nor present').to.eventually.be.true; + await createOrganisationObject.enterOrgName(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - Then(/^I Enter the PBA1 and PBA2 details$/, async function () { - // await waitForElement('govuk-heading-xl'); - browser.sleep(MID_DELAY); - await createOrganisationObject.PBAnumber1.isDisplayed(); - await createOrganisationObject.enterPBANumber(); - // await createOrganisationObject.PBAnumber2.isDisplayed(); - // await createOrganisationObject.enterPBA2Number(); - await createOrganisationObject.continue_button.click(); - browser.sleep(MID_DELAY); - }); +Then(/^I Enter the Office Address details$/, { timeout: 600 * 1000 }, async function () { + // await waitForElement(createOrganisationObject.officeAddressOne); + await expect(createOrganisationObject.officeAddressOne.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.officeAddressOne.sendKeys('1, Cliffinton'); + // browser.sleep(MID_DELAY); + await expect(createOrganisationObject.townName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.townName.sendKeys('London'); + await expect(createOrganisationObject.postcode.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.postcode.sendKeys('SE15TY'); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - Then(/^I Enter the DX Reference details$/, { timeout: 600 * 1000 }, async function () { - await createOrganisationObject.clickDXreferenceCheck(); - browser.sleep(MID_DELAY); - await createOrganisationObject.DXNumber.isDisplayed(); - await createOrganisationObject.enterDXNumber(); - await createOrganisationObject.DXexchange.isDisplayed(); - await createOrganisationObject.enterDXENumber(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); +Then(/^I Enter the PBA1 and PBA2 details$/, async function () { + // await waitForElement('govuk-heading-xl'); + browser.sleep(MID_DELAY); + await createOrganisationObject.PBAnumber1.isDisplayed(); + await createOrganisationObject.enterPBANumber(); + // await createOrganisationObject.PBAnumber2.isDisplayed(); + // await createOrganisationObject.enterPBA2Number(); + await createOrganisationObject.continue_button.click(); + browser.sleep(MID_DELAY); +}); - Then(/^I Select and Enter the SRA number$/, { timeout: 600 * 1000 }, async function () { - // await waitForElement('govuk-heading-xl'); - //await expect(createOrganisationObject.SRACheckBox.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.clickSRAreferenceCheck(); - // browser.sleep(MID_DELAY); - // await waitForElement('govuk-heading-xl'); - await expect(createOrganisationObject.SRANumber.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.enterSRANumber(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); +Then(/^I Enter the DX Reference details$/, { timeout: 600 * 1000 }, async function () { + await createOrganisationObject.clickDXreferenceCheck(); + browser.sleep(MID_DELAY); + await createOrganisationObject.DXNumber.isDisplayed(); + await createOrganisationObject.enterDXNumber(); + await createOrganisationObject.DXexchange.isDisplayed(); + await createOrganisationObject.enterDXENumber(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - Then(/^I Enter the firstName and lastName$/, { timeout: 600 * 1000 }, async function () { - await waitForElement('govuk-heading-xl'); - expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.firstName.sendKeys('Mario'); - expect(createOrganisationObject.lastName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.lastName.sendKeys('Perta'); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); +Then(/^I Select and Enter the SRA number$/, { timeout: 600 * 1000 }, async function () { + // await waitForElement('govuk-heading-xl'); + //await expect(createOrganisationObject.SRACheckBox.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.clickSRAreferenceCheck(); + // browser.sleep(MID_DELAY); + // await waitForElement('govuk-heading-xl'); + await expect(createOrganisationObject.SRANumber.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.enterSRANumber(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - Then(/^I Enter the Email Address$/, { timeout: 600 * 1000 }, async function () { - // await waitForElement('govuk-heading-xl'); - await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; +Then(/^I Enter the firstName and lastName$/, { timeout: 600 * 1000 }, async function () { + await waitForElement('govuk-heading-xl'); + expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.firstName.sendKeys('Mario'); + expect(createOrganisationObject.lastName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.lastName.sendKeys('Perta'); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - global.latestOrgSuperUser = Math.random().toString(36).substring(2) + '@mailinator.com'; - global.latestOrgSuperUserPassword = 'Monday01'; +Then(/^I Enter the Email Address$/, { timeout: 600 * 1000 }, async function () { + // await waitForElement('govuk-heading-xl'); + await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.enterEmailAddress(global.latestOrgSuperUser); - await createOrganisationObject.continue_button.click(); + global.latestOrgSuperUser = Math.random().toString(36).substring(2) + '@mailinator.com'; + global.latestOrgSuperUserPassword = 'Monday01'; - // browser.sleep(MID_DELAY); - }); + await createOrganisationObject.enterEmailAddress(global.latestOrgSuperUser); + await createOrganisationObject.continue_button.click(); - Then(/^I land on the summary page and check submit$/, async function () { - // browser.sleep(MID_DELAY); - // await waitForElement('govuk-heading-l'); + // browser.sleep(MID_DELAY); +}); - await expect(createOrganisationObject.submit_button.isDisplayed()).to.eventually.be.true; - await expect(createOrganisationObject.submit_button.getText()) - .to - .eventually - .equal('Confirm and submit details'); - await createOrganisationObject.submit_button.click(); - }); +Then(/^I land on the summary page and check submit$/, async function () { + // browser.sleep(MID_DELAY); + // await waitForElement('govuk-heading-l'); - Then(/^I created the organisation successfully$/, async function () { - // browser.sleep(MID_DELAY); - createOrganisationObject.waitForSubmission(); - await expect(createOrganisationObject.org_success_heading.isDisplayed()).to.eventually.be.true; - await expect(createOrganisationObject.org_success_heading.getText()) - .to - .eventually - .equal('Registration details submitted'); - }); + await expect(createOrganisationObject.submit_button.isDisplayed()).to.eventually.be.true; + await expect(createOrganisationObject.submit_button.getText()) + .to + .eventually + .equal('Confirm and submit details'); + await createOrganisationObject.submit_button.click(); +}); - When(/^I am not entered Organization name$/, async function () { - createOrganisationObject.org_name.sendKeys(); - await createOrganisationObject.continue_button.click(); - browser.sleep(MID_DELAY); - }); +Then(/^I created the organisation successfully$/, async function () { + // browser.sleep(MID_DELAY); + createOrganisationObject.waitForSubmission(); + await expect(createOrganisationObject.org_success_heading.isDisplayed()).to.eventually.be.true; + await expect(createOrganisationObject.org_success_heading.getText()) + .to + .eventually + .equal('Registration details submitted'); +}); - Then(/^I should be display organization error$/, async function () { - await expect(createOrganisationObject.org_failure_error_heading.isDisplayed()).to.eventually.be.true; - await expect(createOrganisationObject.org_failure_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); +When(/^I am not entered Organization name$/, async function () { + createOrganisationObject.org_name.sendKeys(); + await createOrganisationObject.continue_button.click(); + browser.sleep(MID_DELAY); +}); - When(/^I am not entered the Office Address details$/, async function () { - await createOrganisationObject.officeAddressOne.sendKeys(); - await createOrganisationObject.townName.sendKeys(); - await createOrganisationObject.postcode.sendKeys(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(LONG_DELAY); - }); - Then(/^I should be display Office Address error$/, async function () { - await expect(createOrganisationObject.off_address_error_heading.isDisplayed()).to.eventually.be.true; - await expect(createOrganisationObject.off_address_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); +Then(/^I should be display organization error$/, async function () { + await expect(createOrganisationObject.org_failure_error_heading.isDisplayed()).to.eventually.be.true; + await expect(createOrganisationObject.org_failure_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); - When(/^I am not entered SRA number$/, async function () { - await createOrganisationObject.clickSRAreferenceCheck(); - await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); - await createOrganisationObject.SRANumber.sendKeys(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); +When(/^I am not entered the Office Address details$/, async function () { + await createOrganisationObject.officeAddressOne.sendKeys(); + await createOrganisationObject.townName.sendKeys(); + await createOrganisationObject.postcode.sendKeys(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(LONG_DELAY); +}); +Then(/^I should be display Office Address error$/, async function () { + await expect(createOrganisationObject.off_address_error_heading.isDisplayed()).to.eventually.be.true; + await expect(createOrganisationObject.off_address_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); - Then(/^I should be display SRA error$/, async function () { - await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); - await expect(createOrganisationObject.sra_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); +When(/^I am not entered SRA number$/, async function () { + await createOrganisationObject.clickSRAreferenceCheck(); + await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); + await createOrganisationObject.SRANumber.sendKeys(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - When(/^I am not entered the email address$/, async function () { - await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.emailAddr.sendKeys(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); +Then(/^I should be display SRA error$/, async function () { + await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); + await expect(createOrganisationObject.sra_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); - Then(/^I should be display email error$/, async function () { - await expect(createOrganisationObject.email_error_heading.isDisplayed()).to.eventually.be.true; - await expect(createOrganisationObject.email_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); +When(/^I am not entered the email address$/, async function () { + await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.emailAddr.sendKeys(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - When(/^I Enter the invalid PBA1 and PBA2 details$/, async function () { - await expect(createOrganisationObject.PBAnumber1.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.PBAnumber1.sendKeys(1234455558); - // await createOrganisationObject.PBAnumber2.sendKeys(1233334988); - await createOrganisationObject.continue_button.click(); - // browser.sleep(LONG_DELAY); - }); +Then(/^I should be display email error$/, async function () { + await expect(createOrganisationObject.email_error_heading.isDisplayed()).to.eventually.be.true; + await expect(createOrganisationObject.email_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); - Then(/^I should be display PBA error$/, async function () { - await expect(createOrganisationObject.pba_error_heading.isDisplayed()).to.eventually.be.true; - await expect(createOrganisationObject.pba_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); +When(/^I Enter the invalid PBA1 and PBA2 details$/, async function () { + await expect(createOrganisationObject.PBAnumber1.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.PBAnumber1.sendKeys(1234455558); + // await createOrganisationObject.PBAnumber2.sendKeys(1233334988); + await createOrganisationObject.continue_button.click(); + // browser.sleep(LONG_DELAY); +}); - When(/^I am not entered the firstName and lastName$/, async function () { - await expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.firstName.sendKeys(); - await createOrganisationObject.lastName.sendKeys(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); +Then(/^I should be display PBA error$/, async function () { + await expect(createOrganisationObject.pba_error_heading.isDisplayed()).to.eventually.be.true; + await expect(createOrganisationObject.pba_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); - Then(/^I should be display firstName and lastName error$/, async function () { - await expect(createOrganisationObject.name_error_heading.isDisplayed()).to.eventually.be.true; - await expect(createOrganisationObject.name_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); +When(/^I am not entered the firstName and lastName$/, async function () { + await expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.firstName.sendKeys(); + await createOrganisationObject.lastName.sendKeys(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); - When('I am on page {string} in registration step', async function (page) { - await createOrganisationObject.waitForPage(page); - }); +Then(/^I should be display firstName and lastName error$/, async function () { + await expect(createOrganisationObject.name_error_heading.isDisplayed()).to.eventually.be.true; + await expect(createOrganisationObject.name_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); - Then('I see content header already registered account', function () { - expect(createOrganisationObject.getAlreadyRegisteredAccountHeaderText()).to - .eventually. - equal('Already registered for a MyHMCTS account?'); - }); +When('I am on page {string} in registration step', async function (page) { + await createOrganisationObject.waitForPage(page); +}); - Then('I see manage cases link under already registered account header', function () { - expect(createOrganisationObject.isManageCasesLinkPresent()).to - .eventually. - be.true; - }); +Then('I see content header already registered account', function () { + expect(createOrganisationObject.getAlreadyRegisteredAccountHeaderText()).to + .eventually. + equal('Already registered for a MyHMCTS account?'); +}); - Then('I see manage org link under already registered account header', function () { - expect(createOrganisationObject.isManageOrgLinkPresent()).to - .eventually. - be.true; - }); +Then('I see manage cases link under already registered account header', function () { + expect(createOrganisationObject.isManageCasesLinkPresent()).to + .eventually. + be.true; +}); - Then('I click and validate MC link opens in new tab', async function () { - await createOrganisationObject.clickAndValidateMCLink(); - }); +Then('I see manage org link under already registered account header', function () { + expect(createOrganisationObject.isManageOrgLinkPresent()).to + .eventually. + be.true; +}); - Then('I click and validate MO link opens in new tab', async function () { - await createOrganisationObject.clickAndValidateMOLink(); - }); +Then('I click and validate MC link opens in new tab', async function () { + await createOrganisationObject.clickAndValidateMCLink(); +}); - When('I click back link in register org workflow', async function () { - await createOrganisationObject.clickBackLink(); - }); +Then('I click and validate MO link opens in new tab', async function () { + await createOrganisationObject.clickAndValidateMOLink(); +}); + +When('I click back link in register org workflow', async function () { + await createOrganisationObject.clickBackLink(); }); diff --git a/test/e2e/features/step_definitions/dataSetUp.steps.js b/test/e2e/features/step_definitions/dataSetUp.steps.js index b462a9bed..6f0e2131b 100644 --- a/test/e2e/features/step_definitions/dataSetUp.steps.js +++ b/test/e2e/features/step_definitions/dataSetUp.steps.js @@ -1,7 +1,8 @@ 'use strict'; +const { When, Given } = require('@cucumber/cucumber'); + const CreateOrganisationObjects = require('../pageObjects/createOrganisationObjects'); -const { defineSupportCode } = require('cucumber'); const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); const { config } = require('../../config/common.conf.js'); const approveOrganizationService = require('../pageObjects/approveOrganizationService'); @@ -9,51 +10,49 @@ const mailinatorService = require('../pageObjects/mailinatorService'); const EC = protractor.ExpectedConditions; -defineSupportCode(function ({ Given, When, Then }) { - const createOrganisationObject = new CreateOrganisationObjects(); +const createOrganisationObject = new CreateOrganisationObjects(); - Given('I create test read write organisation', async function () { - if (global.testorgStatus >= 1){ - return; - } - global.TestOrg_rw_name = 'AUTOTEST_RW_' + Date.now(); - global.testorg_rw_superuser_email = 'autotest_user' + Date.now() + '@mailinator.com'; +Given('I create test read write organisation', async function () { + if (global.testorgStatus >= 1){ + return; + } + global.TestOrg_rw_name = 'AUTOTEST_RW_' + Date.now(); + global.testorg_rw_superuser_email = 'autotest_user' + Date.now() + '@mailinator.com'; - await browser.get(config.config.baseUrl + '/register-org/register'); - await createOrganisationObject.createOrganisation(global.TestOrg_rw_name, global.testorg_rw_superuser_email); + await browser.get(config.config.baseUrl + '/register-org/register'); + await createOrganisationObject.createOrganisation(global.TestOrg_rw_name, global.testorg_rw_superuser_email); - global.testorgStatus = '1'; - }); + global.testorgStatus = '1'; +}); - Given('I approve test read write organisation', { timeout: 300 * 1000 }, async function () { - if (global.testorgStatus >= 2) { - return; - } - await approveOrganizationService.init(); - try { - await approveOrganizationService.approveOrg(global.TestOrg_rw_name); - global.testorgStatus = '2'; - await approveOrganizationService.destroy(); - } catch (err){ - this.attach('Error occured Approving organisation'); - await approveOrganizationService.destroy(); - logger(this, await approveOrganizationService.getScrenshot(), true); - await approveOrganizationService.destroy(); - throw err; - } - }); +Given('I approve test read write organisation', { timeout: 300 * 1000 }, async function () { + if (global.testorgStatus >= 2) { + return; + } + await approveOrganizationService.init(); + try { + await approveOrganizationService.approveOrg(global.TestOrg_rw_name); + global.testorgStatus = '2'; + await approveOrganizationService.destroy(); + } catch (err){ + this.attach('Error occured Approving organisation'); + await approveOrganizationService.destroy(); + logger(this, await approveOrganizationService.getScrenshot(), true); + await approveOrganizationService.destroy(); + throw err; + } +}); - When('I activate test read write approved organisation super user', { timeout: 300 * 1000 }, async function () { - if (global.testorgStatus >= 3) { - return; - } - await mailinatorService.init(); - mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - await mailinatorService.openRegistrationEmailForUser(global.testorg_rw_superuser_email); - await mailinatorService.completeUserRegistrationFromEmail(); - await mailinatorService.destroy(); - global.testorgStatus = '3'; - }); +When('I activate test read write approved organisation super user', { timeout: 300 * 1000 }, async function () { + if (global.testorgStatus >= 3) { + return; + } + await mailinatorService.init(); + mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + await mailinatorService.openRegistrationEmailForUser(global.testorg_rw_superuser_email); + await mailinatorService.completeUserRegistrationFromEmail(); + await mailinatorService.destroy(); + global.testorgStatus = '3'; }); function logger(world, message, isScreenshot) { diff --git a/test/e2e/features/step_definitions/headerPage.steps.js b/test/e2e/features/step_definitions/headerPage.steps.js index 1c8b0e39e..b12a1cb29 100644 --- a/test/e2e/features/step_definitions/headerPage.steps.js +++ b/test/e2e/features/step_definitions/headerPage.steps.js @@ -1,4 +1,6 @@ +const { Then} = require('@cucumber/cucumber') + const HeaderPage = require('../pageObjects/headerPage'); const ViewUserPage = require('../pageObjects/viewUserPage.js'); const InviteUserPage = require('../pageObjects/inviteUserPage.js'); @@ -12,7 +14,6 @@ const EC = protractor.ExpectedConditions; const mailinatorService = require('../pageObjects/mailinatorService'); -const { defineSupportCode } = require('cucumber'); async function waitForElement(el) { await browser.wait((result) => { @@ -20,11 +21,9 @@ async function waitForElement(el) { }, 600000); } -defineSupportCode(function ({ And, But, Given, Then, When }) { - const headerPage = new HeaderPage(); +const headerPage = new HeaderPage(); - Then('I should see navigation tab in header', async function (dataTable) { - await headerPage.waitForPrimaryNavigationToDisplay(); - await headerPage.validateNavigationTabDisplayed(dataTable); - }); +Then('I should see navigation tab in header', async function (dataTable) { + await headerPage.waitForPrimaryNavigationToDisplay(); + await headerPage.validateNavigationTabDisplayed(dataTable); }); diff --git a/test/e2e/features/step_definitions/inviteUser.steps.js b/test/e2e/features/step_definitions/inviteUser.steps.js index c45a0626d..839296a5f 100644 --- a/test/e2e/features/step_definitions/inviteUser.steps.js +++ b/test/e2e/features/step_definitions/inviteUser.steps.js @@ -1,3 +1,5 @@ +const { Then, When} = require('@cucumber/cucumber'); + const loginPage = require('../pageObjects/loginLogoutObjects'); const HeaderPage = require('../pageObjects/headerPage'); const ViewUserPage = require('../pageObjects/viewUserPage.js'); @@ -5,8 +7,8 @@ const InviteUserPage = require('../pageObjects/inviteUserPage.js'); const TestData = require('../../utils/TestData.js'); const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); -Dropdown = require('../pageObjects/webdriver-components/dropdown.js'); -TextField = require('../pageObjects/webdriver-components/textField.js'); +const Dropdown = require('../pageObjects/webdriver-components/dropdown.js'); +const TextField = require('../pageObjects/webdriver-components/textField.js'); const { config } = require('../../config/common.conf.js'); const EC = protractor.ExpectedConditions; @@ -14,7 +16,6 @@ const mailinatorService = require('../pageObjects/mailinatorService'); const browserWaits = require('../../support/customWaits'); const CucumberReportLogger = require('../../support/reportLogger'); -const { defineSupportCode } = require('cucumber'); const cucumberHtmlReporter = require('cucumber-html-reporter'); const { Error } = require('globalthis/implementation'); @@ -24,161 +25,159 @@ async function waitForElement(el) { }, 600000); } -defineSupportCode(function ({ And, But, Given, Then, When }) { - const inviteUserPage=new InviteUserPage(); - const viewUserPage=new ViewUserPage(); - const headerPage = new HeaderPage(); +const inviteUserPage=new InviteUserPage(); +const viewUserPage=new ViewUserPage(); +const headerPage = new HeaderPage(); - const invitedUserEmail = ''; +const invitedUserEmail = ''; - When(/^I click on invite user button$/, async function () { - await viewUserPage.clickInviteUser(); - // browser.sleep(LONG_DELAY); - }); +When(/^I click on invite user button$/, async function () { + await viewUserPage.clickInviteUser(); + // browser.sleep(LONG_DELAY); +}); - When(/^I navigate to invite user page$/, async function () { - const inviteUserPath = config.config.baseUrl.endsWith('/') ? 'users/invite-user' : '/users/invite-user'; - await browser.driver.get(config.config.baseUrl + inviteUserPath); - await inviteUserPage.waitForPage(); - }); +When(/^I navigate to invite user page$/, async function () { + const inviteUserPath = config.config.baseUrl.endsWith('/') ? 'users/invite-user' : '/users/invite-user'; + await browser.driver.get(config.config.baseUrl + inviteUserPath); + await inviteUserPage.waitForPage(); +}); - Then(/^I should be on display invite user page$/, async function () { - // browser.sleep(AMAZING_DELAY);; - await inviteUserPage.waitForPage(); - expect(await inviteUserPage.amOnPage(), 'Invite User page is not displayed').to.be.true; - }); +Then(/^I should be on display invite user page$/, async function () { + // browser.sleep(AMAZING_DELAY);; + await inviteUserPage.waitForPage(); + expect(await inviteUserPage.amOnPage(), 'Invite User page is not displayed').to.be.true; +}); - When(/^I enter mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { - await inviteUserPage.waitForPage(); - await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); - await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); +When(/^I enter mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { + await inviteUserPage.waitForPage(); + await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); + await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); - // var emailAddress =Math.random().toString(36).substring(2); - global.latestInvitedUser = Math.random().toString(36).substring(2)+'@mailinator.com'; - global.latestInvitedUserPassword = 'Monday01'; + // var emailAddress =Math.random().toString(36).substring(2); + global.latestInvitedUser = Math.random().toString(36).substring(2)+'@mailinator.com'; + global.latestInvitedUserPassword = 'Monday01'; - await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); - await inviteUserPage.manageUserCheckbox.click(); - browser.sleep(LONG_DELAY); + await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); + await inviteUserPage.manageUserCheckbox.click(); + browser.sleep(LONG_DELAY); + await inviteUserPage.clickSendInvitationButton(); + // browser.sleep(LONG_DELAY); +}); +Then(/^user should be created successfuly$/, async function () { + const world = this; + await browserWaits.retryWithAction(inviteUserPage.userInvitaionConfirmation, async (message) => { + world.attach('Retry clicking Invite user button : ' + message); + global.screenShotUtils.takeScreenshot() + .then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }); await inviteUserPage.clickSendInvitationButton(); - // browser.sleep(LONG_DELAY); - }); - Then(/^user should be created successfuly$/, async function () { - const world = this; - await browserWaits.retryWithAction(inviteUserPage.userInvitaionConfirmation, async (message) => { - world.attach('Retry clicking Invite user button : ' + message); - global.screenShotUtils.takeScreenshot() - .then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }); - await inviteUserPage.clickSendInvitationButton(); - }); - - expect(await inviteUserPage.amOnUserConfirmationPage()).to.be.true; }); - When(/^I not enter the mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { - await inviteUserPage.enterIntoTextFieldFirstName(''); - await inviteUserPage.enterIntoTextFieldLastName(''); - await inviteUserPage.enterIntoTextFieldEmailAddress(''); - await inviteUserPage.clickSendInvitationButton(); - }); + expect(await inviteUserPage.amOnUserConfirmationPage()).to.be.true; +}); - When('I enter mandatory fields firstname,lastname,emailaddress with permissions and click on send invitation button', async function (table) { - await inviteUserPage.waitForPage(); - await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); - await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); - global.latestInvitedUser = Math.random().toString(36).substring(2) + '@mailinator.com'; - global.latestInvitedUserPassword = 'Monday01'; - - await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); - const permissions = table.hashes(); - for (let permCounter = 0; permCounter < permissions.length; permCounter++){ - await inviteUserPage.selectPermission(permissions[permCounter].Permission, true); - } - await inviteUserPage.clickSendInvitationButton(); - }); +When(/^I not enter the mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { + await inviteUserPage.enterIntoTextFieldFirstName(''); + await inviteUserPage.enterIntoTextFieldLastName(''); + await inviteUserPage.enterIntoTextFieldEmailAddress(''); + await inviteUserPage.clickSendInvitationButton(); +}); - When('I edit user permissions', async function (table) { - const permissions = table.hashes(); - for (let permCounter = 0; permCounter < permissions.length; permCounter++) { - await inviteUserPage.selectPermission(permissions[permCounter].Permission, permissions[permCounter].isSelected === 'true'); - } - }); +When('I enter mandatory fields firstname,lastname,emailaddress with permissions and click on send invitation button', async function (table) { + await inviteUserPage.waitForPage(); + await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); + await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); + global.latestInvitedUser = Math.random().toString(36).substring(2) + '@mailinator.com'; + global.latestInvitedUserPassword = 'Monday01'; + + await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); + const permissions = table.hashes(); + for (let permCounter = 0; permCounter < permissions.length; permCounter++){ + await inviteUserPage.selectPermission(permissions[permCounter].Permission, true); + } + await inviteUserPage.clickSendInvitationButton(); +}); - Then(/^I should be display the validation error$/, async function () { - await expect(inviteUserPage.failure_error_heading.isDisplayed()).to.eventually.be.true; - await expect(inviteUserPage.failure_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); +When('I edit user permissions', async function (table) { + const permissions = table.hashes(); + for (let permCounter = 0; permCounter < permissions.length; permCounter++) { + await inviteUserPage.selectPermission(permissions[permCounter].Permission, permissions[permCounter].isSelected === 'true'); + } +}); - When(/^I click on back button$/, async function () { - // browser.sleep(AMAZING_DELAY); - await inviteUserPage.clickBackButton(); - }); +Then(/^I should be display the validation error$/, async function () { + await expect(inviteUserPage.failure_error_heading.isDisplayed()).to.eventually.be.true; + await expect(inviteUserPage.failure_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); - Then('I activate invited user', { timeout: 600 * 1000 }, async function () { - await mailinatorService.init(); - try { - mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - await mailinatorService.openRegistrationEmailForUser(global.latestInvitedUser); - this.attach('Registration email received successfully.'); - await mailinatorService.completeUserRegistrationFromEmail(); - this.attach('Registration completed successfully.'); - await mailinatorService.destroy(); - } catch (err){ - await CucumberReportLogger.AddScreenshot(mailinatorService.getScreenShotUtil()); - await mailinatorService.destroy(); - throw new Error('Error occured during user activation steps', err); - } - }); +When(/^I click on back button$/, async function () { + // browser.sleep(AMAZING_DELAY); + await inviteUserPage.clickBackButton(); +}); - Then(/^I click on a Active User$/, async function () { - browser.sleep(AMAZING_DELAY); - await expect(inviteUserPage.activeUser.isDisplayed()).to.eventually.be.true; - await inviteUserPage.activeUser.click(); - }); +Then('I activate invited user', { timeout: 600 * 1000 }, async function () { + await mailinatorService.init(); + try { + mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + await mailinatorService.openRegistrationEmailForUser(global.latestInvitedUser); + this.attach('Registration email received successfully.'); + await mailinatorService.completeUserRegistrationFromEmail(); + this.attach('Registration completed successfully.'); + await mailinatorService.destroy(); + } catch (err){ + await CucumberReportLogger.AddScreenshot(mailinatorService.getScreenShotUtil()); + await mailinatorService.destroy(); + throw new Error('Error occured during user activation steps', err); + } +}); - Then(/^I see change link and suspend button$/, async function () { - browser.sleep(MID_DELAY); - await expect(inviteUserPage.changeLink.isDisplayed()).to.eventually.be.true; - await expect(inviteUserPage.suspendButton.isDisplayed()).to.eventually.be.true; - }); +Then(/^I click on a Active User$/, async function () { + browser.sleep(AMAZING_DELAY); + await expect(inviteUserPage.activeUser.isDisplayed()).to.eventually.be.true; + await inviteUserPage.activeUser.click(); +}); - Then(/^I click on change link$/, async function () { - browser.sleep(MID_DELAY); - await inviteUserPage.changeLink.click(); - await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; - await expect(inviteUserPage.editUserText.getText()) - .to - .eventually - .equal('Edit user'); - }); +Then(/^I see change link and suspend button$/, async function () { + browser.sleep(MID_DELAY); + await expect(inviteUserPage.changeLink.isDisplayed()).to.eventually.be.true; + await expect(inviteUserPage.suspendButton.isDisplayed()).to.eventually.be.true; +}); - Then(/^I edit the Manage User checkbox and click submit$/, async function () { - browser.sleep(MID_DELAY); - await inviteUserPage.manageUserCheckbox.click(); - await inviteUserPage.clickSendInvitationButton(); - browser.sleep(MID_DELAY); - await viewUserPage.waitForUserDetailsPage(); - await expect(inviteUserPage.suspendButton.isDisplayed()).to.eventually.be.true; - }); +Then(/^I click on change link$/, async function () { + browser.sleep(MID_DELAY); + await inviteUserPage.changeLink.click(); + await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; + await expect(inviteUserPage.editUserText.getText()) + .to + .eventually + .equal('Edit user'); +}); - Then(/^I click the suspend button$/, async function () { - await inviteUserPage.suspendButton.click(); - }); +Then(/^I edit the Manage User checkbox and click submit$/, async function () { + browser.sleep(MID_DELAY); + await inviteUserPage.manageUserCheckbox.click(); + await inviteUserPage.clickSendInvitationButton(); + browser.sleep(MID_DELAY); + await viewUserPage.waitForUserDetailsPage(); + await expect(inviteUserPage.suspendButton.isDisplayed()).to.eventually.be.true; +}); - Then(/^I see the suspend user page$/, async function () { - browser.sleep(MID_DELAY); - await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; - await expect(inviteUserPage.editUserText.getText()) - .to - .eventually - .equal('Are you sure you want to suspend this account?'); - }); +Then(/^I click the suspend button$/, async function () { + await inviteUserPage.suspendButton.click(); +}); + +Then(/^I see the suspend user page$/, async function () { + browser.sleep(MID_DELAY); + await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; + await expect(inviteUserPage.editUserText.getText()) + .to + .eventually + .equal('Are you sure you want to suspend this account?'); }); function logger(world, message, isScreenshot){ diff --git a/test/e2e/features/step_definitions/loginLogout.steps.js b/test/e2e/features/step_definitions/loginLogout.steps.js index 28daacb05..eca8ecdbe 100644 --- a/test/e2e/features/step_definitions/loginLogout.steps.js +++ b/test/e2e/features/step_definitions/loginLogout.steps.js @@ -1,7 +1,8 @@ 'use strict'; +const { Given, Then, When} = require('@cucumber/cucumber'); + const loginPage = require('../pageObjects/loginLogoutObjects'); -const { defineSupportCode } = require('cucumber'); const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); const { config } = require('../../config/common.conf.js'); const EC = protractor.ExpectedConditions; @@ -22,219 +23,222 @@ async function waitForElement(el) { }, 40000); } -defineSupportCode(function ({ Given, When, Then }) { - When(/^I navigate to manage organisation Url$/, { timeout: 600 * 1000 }, async function () { - const world = this; - await browser.driver.manage().deleteAllCookies(); +When(/^I navigate to manage organisation Url$/, { timeout: 600 * 1000 }, async function () { + const world = this; + await browser.driver.manage().deleteAllCookies(); + await browser.get(config.config.baseUrl); + await browserWaits.retryWithAction(loginPage.emailAddress, async function (message) { + const stream = await browser.takeScreenshot(); + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); await browser.get(config.config.baseUrl); - await browserWaits.retryWithAction(loginPage.emailAddress, async function (message) { - const stream = await browser.takeScreenshot(); - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - await browser.get(config.config.baseUrl); - }); - await browserWaits.waitForElement(loginPage.emailAddress, LONG_DELAY, 'IDAM login page Email Address input not present'); - }); - - Then(/^I should see failure error summary$/, async function () { - await waitForElement('heading-large'); - await expect(loginPage.failure_error_heading.isDisplayed()).to.eventually.be.true; - await expect(loginPage.failure_error_heading.getText()) - .to - .eventually - .equal('Incorrect email or password'); - }); - - Then(/^I am on Idam login page$/, { timeout: 600 * 1000 }, async function () { - await waitForElement('heading-large'); - await expect(loginPage.signinTitle.isDisplayed()).to.eventually.be.true; - await expect(loginPage.signinTitle.getText()) - .to - .eventually - .equal('Sign in'); - await expect(loginPage.emailAddress.isDisplayed()).to.eventually.be.true; - await expect(loginPage.password.isDisplayed()).to.eventually.be.true; - }); - - When('I login with latest invited user', async function () { - const world = this; - this.attach('User email : ' + global.latestInvitedUser); - await loginattemptCheckAndRelogin(global.latestInvitedUser, global.latestInvitedUserPassword, world); - }); - - When(/^I enter an valid email-address and password to login$/, async function () { - await loginPage.emailAddress.sendKeys(config.config.username); //replace username and password - await loginPage.password.sendKeys(config.config.password); - // browser.sleep(SHORT_DELAY); - await loginPage.signinBtn.click(); - browser.sleep(SHORT_DELAY); }); + await browserWaits.waitForElement(loginPage.emailAddress, LONG_DELAY, 'IDAM login page Email Address input not present'); +}); - When(/^I enter an Invalid email-address and password to login$/, async function () { - await loginPage.givenIAmUnauthenticatedUser(); - }); +Then(/^I should see failure error summary$/, async function () { + await waitForElement('heading-large'); + await expect(loginPage.failure_error_heading.isDisplayed()).to.eventually.be.true; + await expect(loginPage.failure_error_heading.getText()) + .to + .eventually + .equal('Incorrect email or password'); +}); - Given(/^I should be redirected to the Idam login page$/, async function () { - browser.sleep(LONG_DELAY); - await expect(loginPage.signinTitle.getText()) - .to - .eventually - .equal('Sign in'); - browser.sleep(LONG_DELAY); - }); +Then(/^I am on Idam login page$/, { timeout: 600 * 1000 }, async function () { + await waitForElement('heading-large'); + await expect(loginPage.signinTitle.isDisplayed()).to.eventually.be.true; + await expect(loginPage.signinTitle.getText()) + .to + .eventually + .equal('Sign in'); + await expect(loginPage.emailAddress.isDisplayed()).to.eventually.be.true; + await expect(loginPage.password.isDisplayed()).to.eventually.be.true; +}); - Then(/^I select the sign out link$/, { timeout: 120 * 1000 }, async function () { - await browserWaits.waitForElement(loginPage.signOutlink, LONG_DELAY, 'Signout link not present in page'); - await expect(loginPage.signOutlink.isDisplayed()).to.eventually.be.true; - await headerPage.waitForSpinnerNotPresent(); - await loginPage.signOutlink.click(); - await browserWaits.waitForElement(loginPage.emailAddress, LONG_DELAY, 'Login page is not displayed after signout'); - }); +When('I login with latest invited user', async function () { + const world = this; + this.attach('User email : ' + global.latestInvitedUser); + await loginattemptCheckAndRelogin(global.latestInvitedUser, global.latestInvitedUserPassword, world); +}); - Then(/^I should be redirected to manage organisation dashboard page$/, async function () { - await browserWaits.waitForElement(loginPage.dashboard_header, LONG_DELAY, 'Dashboard Header not present'); - await browserWaits.waitForElement(headerPage.hmctsPrimaryNavigation, LONG_DELAY, 'Primary navigation Tab not present'); +When(/^I enter an valid email-address and password to login$/, async function () { + await loginPage.emailAddress.sendKeys(config.config.username); //replace username and password + await loginPage.password.sendKeys(config.config.password); + // browser.sleep(SHORT_DELAY); + await loginPage.signinBtn.click(); + browser.sleep(SHORT_DELAY); +}); - await expect(loginPage.dashboard_header.isDisplayed(), 'Dashboard header not displayed').to.eventually.be.true; - await expect(loginPage.dashboard_header.getText()) - .to - .eventually - .equal('Manage organisation'); +When(/^I enter an Invalid email-address and password to login$/, async function () { + await loginPage.givenIAmUnauthenticatedUser(); +}); - await expect(headerPage.isPrimaryNavigationTabDisplayed(), 'Primary navigation tabs not displayed').to.eventually.be.true; - browser.sleep(LONG_DELAY); - }); +Given(/^I should be redirected to the Idam login page$/, async function () { + browser.sleep(LONG_DELAY); + await expect(loginPage.signinTitle.getText()) + .to + .eventually + .equal('Sign in'); + browser.sleep(LONG_DELAY); +}); - // Given(/^I am logged into manage organisation with ManageOrg user details$/, async function () { - // browser.sleep(LONG_DELAY); - // await loginPage.emailAddress.sendKeys(config.config.username); - // await loginPage.password.sendKeys(config.config.password); - // await loginPage.clickSignIn(); - // browser.sleep(MID_DELAY); - // }); +Then(/^I select the sign out link$/, { timeout: 120 * 1000 }, async function () { + await browserWaits.waitForElement(loginPage.signOutlink, LONG_DELAY, 'Signout link not present in page'); + await expect(loginPage.signOutlink.isDisplayed()).to.eventually.be.true; + await headerPage.waitForSpinnerNotPresent(); + await loginPage.signOutlink.click(); + await browserWaits.waitForElement(loginPage.emailAddress, LONG_DELAY, 'Login page is not displayed after signout'); +}); - // Given(/^I am logged into manage organisation with ManageOrg user details$/, async function () { - // browser.sleep(LONG_DELAY); - // await loginPage.emailAddress.sendKeys(config.config.username); - // await loginPage.password.sendKeys(config.config.password); - // await loginPage.clickSignIn(); - // browser.sleep(MID_DELAY); - // }); +Then(/^I should be redirected to manage organisation dashboard page$/, async function () { + await browserWaits.waitForElement(loginPage.dashboard_header, LONG_DELAY, 'Dashboard Header not present'); + await browserWaits.waitForElement(headerPage.hmctsPrimaryNavigation, LONG_DELAY, 'Primary navigation Tab not present'); - Given(/^I am logged into manage organisation with ManageOrg user details$/, async function () { - // browser.sleep(LONG_DELAY); - const world = this; + await expect(loginPage.dashboard_header.isDisplayed(), 'Dashboard header not displayed').to.eventually.be.true; + await expect(loginPage.dashboard_header.getText()) + .to + .eventually + .equal('Manage organisation'); - await loginattemptCheckAndRelogin(process.env.TEST_USER1_EMAIL, process.env.TEST_USER1_PASSWORD, world); + await expect(headerPage.isPrimaryNavigationTabDisplayed(), 'Primary navigation tabs not displayed').to.eventually.be.true; + browser.sleep(LONG_DELAY); +}); - // browser.sleep(LONG_DELAY); - }); +// Given(/^I am logged into manage organisation with ManageOrg user details$/, async function () { +// browser.sleep(LONG_DELAY); +// await loginPage.emailAddress.sendKeys(config.config.username); +// await loginPage.password.sendKeys(config.config.password); +// await loginPage.clickSignIn(); +// browser.sleep(MID_DELAY); +// }); + +// Given(/^I am logged into manage organisation with ManageOrg user details$/, async function () { +// browser.sleep(LONG_DELAY); +// await loginPage.emailAddress.sendKeys(config.config.username); +// await loginPage.password.sendKeys(config.config.password); +// await loginPage.clickSignIn(); +// browser.sleep(MID_DELAY); +// }); + +Given(/^I am logged into manage organisation with ManageOrg user details$/, async function () { + // browser.sleep(LONG_DELAY); + const world = this; + + await loginattemptCheckAndRelogin(process.env.TEST_USER1_EMAIL, process.env.TEST_USER1_PASSWORD, world); + + // browser.sleep(LONG_DELAY); +}); - Given(/^I am logged into manage organisation to invite users$/, async function () { - // browser.sleep(LONG_DELAY); - const world = this; +Given(/^I am logged into manage organisation to invite users$/, async function () { + // browser.sleep(LONG_DELAY); + const world = this; - await loginattemptCheckAndRelogin(config.config.username_rw, config.config.password_rw, world); + await loginattemptCheckAndRelogin(config.config.username_rw, config.config.password_rw, world); - // browser.sleep(LONG_DELAY); - }); + // browser.sleep(LONG_DELAY); +}); - Given(/^I am logged into Townley Services Org$/, async function () { - await loginPage.emailAddress.sendKeys(config.config.townleyUser); //replace username and password - await loginPage.password.sendKeys(config.config.townleyPassword); - // browser.sleep(SHORT_DELAY); - await loginPage.signinBtn.click(); - browser.sleep(SHORT_DELAY); - }); +Given(/^I am logged into Townley Services Org$/, async function () { + console.log(config.config.townleyUser) + await loginPage.emailAddress.sendKeys(config.config.townleyUser); //replace username and password + await loginPage.password.sendKeys(config.config.townleyPassword); + // browser.sleep(SHORT_DELAY); + await loginPage.signinBtn.click(); + browser.sleep(SHORT_DELAY); +}); - Given('I am logged into manage organisation with test org user', async function(){ - const world = this; - this.attach('Login user : ' + global.testorg_rw_superuser_email); - console.log('Login user : ' + global.testorg_rw_superuser_email); - await loginattemptCheckAndRelogin(global.testorg_rw_superuser_email, 'Monday01', world); - - const tandcfeatureToggle = await acceptTermsAndConditionsPage.isFeatureToggleEnabled(this); - if (tandcfeatureToggle){ - if (global.testorgStatus >= 4) { - console.log('User accepted T&C already'); - } else { - await waitForElement('hmcts-header__link'); - const tandcAcceptPageDisplayed = await acceptTermsAndConditionsPage.amOnPage(); - console.log('tandcAcceptPageDisplayed : ' + tandcAcceptPageDisplayed); - await acceptTermsAndConditionsPage.acceptTremsAndConditions(); - global.testorgStatus = 4; - } +Given('I am logged into manage organisation with test org user', async function(){ + const world = this; + this.attach('Login user : ' + global.testorg_rw_superuser_email); + console.log('Login user : ' + global.testorg_rw_superuser_email); + await loginattemptCheckAndRelogin(global.testorg_rw_superuser_email, 'Monday01', world); + + const tandcfeatureToggle = await acceptTermsAndConditionsPage.isFeatureToggleEnabled(this); + if (tandcfeatureToggle){ + if (global.testorgStatus >= 4) { + console.log('User accepted T&C already'); + } else { + await waitForElement('hmcts-header__link'); + const tandcAcceptPageDisplayed = await acceptTermsAndConditionsPage.amOnPage(); + console.log('tandcAcceptPageDisplayed : ' + tandcAcceptPageDisplayed); + await acceptTermsAndConditionsPage.acceptTremsAndConditions(); + global.testorgStatus = 4; } - }); + } +}); - Given('I am logged in to created approve organisation', async function () { - // browser.sleep(LONG_DELAY); - await loginattemptCheckAndRelogin(global.latestOrgSuperUser, 'Monday01', this); - browser.wait(async () => { - return !(await loginPage.emailAddress.isPresent()); - }, 30000); - - if (config.config.twoFactorAuthEnabled){ - const verificationCodeInput = element(by.css('#code')); - await browserWaits.waitForElement(verificationCodeInput); - if (await verificationCodeInput.isPresent()) { - const loginVerificationCode = await mailinatorService.getLoginVerificationEmailCode(global.latestOrgSuperUser); - await verificationCodeInput.sendKeys(loginVerificationCode); - await element(by.css('.button[type = \'submit\']')).click(); - } +Given('I am logged in to created approve organisation', async function () { + // browser.sleep(LONG_DELAY); + await loginattemptCheckAndRelogin(global.latestOrgSuperUser, 'Monday01', this); + browser.wait(async () => { + return !(await loginPage.emailAddress.isPresent()); + }, 30000); + + if (config.config.twoFactorAuthEnabled){ + const verificationCodeInput = element(by.css('#code')); + await browserWaits.waitForElement(verificationCodeInput); + if (await verificationCodeInput.isPresent()) { + const loginVerificationCode = await mailinatorService.getLoginVerificationEmailCode(global.latestOrgSuperUser); + await verificationCodeInput.sendKeys(loginVerificationCode); + await element(by.css('.button[type = \'submit\']')).click(); } - }); + } +}); - Given(/^I navigate to manage organisation Url direct link$/, async function () { +Given(/^I navigate to manage organisation Url direct link$/, async function () { + await browser.get(config.config.baseUrl + '/cases/case-filter'); + // await browser.driver.manage() + // .deleteAllCookies(); + // await browser.refresh(); + // browser.sleep(AMAZING_DELAY); +}); + +Then(/^I should be redirected back to Login page after direct link$/, { timeout: 120 * 1000 }, async function () { + // await browserWaits.waitForElement(loginPage.emailAddress); + await browserWaits.retryWithAction(loginPage.emailAddress, async () => { + console.log('ReTry for login page after direct link '); + this.attach('ReTry for login page after direct link '); await browser.get(config.config.baseUrl + '/cases/case-filter'); - // await browser.driver.manage() - // .deleteAllCookies(); - // await browser.refresh(); - // browser.sleep(AMAZING_DELAY); }); + await expect(loginPage.signinTitle.getText()) + .to + .eventually + .equal('Sign in'); + browser.sleep(LONG_DELAY); +}); - Then(/^I should be redirected back to Login page after direct link$/, { timeout: 120 * 1000 }, async function () { - // await browserWaits.waitForElement(loginPage.emailAddress); - await browserWaits.retryWithAction(loginPage.emailAddress, async () => { - console.log('ReTry for login page after direct link '); - this.attach('ReTry for login page after direct link '); - await browser.get(config.config.baseUrl + '/cases/case-filter'); - }); - await expect(loginPage.signinTitle.getText()) - .to - .eventually - .equal('Sign in'); - browser.sleep(LONG_DELAY); - }); +Then('I login to MC with invited user', { timeout: 120 * 1000 }, async function () { + await manageCasesService.init(); + manageCasesService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + // manageCasesService.setWorld(this); + await manageCasesService.login(global.latestInvitedUser, global.latestInvitedUserPassword); + await manageCasesService.destroy(); +}); - Then('I login to MC with invited user', { timeout: 120 * 1000 }, async function () { - await manageCasesService.init(); - manageCasesService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - // manageCasesService.setWorld(this); +Then('I see login to MC with invited user is {string}', { timeout: 120 * 1000 }, async function (loginStatus) { + await manageCasesService.init(); + manageCasesService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + try { await manageCasesService.login(global.latestInvitedUser, global.latestInvitedUserPassword); - await manageCasesService.destroy(); - }); - - Then('I see login to MC with invited user is {string}', { timeout: 120 * 1000 }, async function (loginStatus) { - await manageCasesService.init(); - manageCasesService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - try { - await manageCasesService.login(global.latestInvitedUser, global.latestInvitedUserPassword); - if (loginStatus.includes('success')) { - await manageCasesService.validateLoginSuccess(); - } else { - await manageCasesService.validateLoginFailure(); - } - await manageCasesService.destroy(); - } catch (err){ - await manageCasesService.attachScreenshot(); - await manageCasesService.destroy(); - throw err; + if (loginStatus.includes('success')) { + await manageCasesService.validateLoginSuccess(); + } else { + await manageCasesService.validateLoginFailure(); } - }); + await manageCasesService.destroy(); + } catch (err){ + await manageCasesService.attachScreenshot(); + await manageCasesService.destroy(); + throw err; + } }); async function loginWithCredentials(username, password, world){ + console.log('loginWithCredentials'); + console.log(username); + console.log(password); + console.log('loginWithCredentials'); await browserWaits.retryForPageLoad(loginPage.emailAddress, async function (message) { world.attach('Retrying Login page load : ' + message); const stream = await browser.takeScreenshot(); diff --git a/test/e2e/features/step_definitions/viewOrganisation.steps.js b/test/e2e/features/step_definitions/viewOrganisation.steps.js index 7e6c1d409..33897573a 100644 --- a/test/e2e/features/step_definitions/viewOrganisation.steps.js +++ b/test/e2e/features/step_definitions/viewOrganisation.steps.js @@ -1,3 +1,5 @@ +const { When, Then} = require('@cucumber/cucumber'); + const ViewOrganisationPage = require('../pageObjects/viewOrganisationPage.js'); const HeaderPage = require('../pageObjects/headerPage'); const loginPage = require('../pageObjects/loginLogoutObjects'); @@ -6,56 +8,53 @@ const EC = protractor.ExpectedConditions; const browserWaits = require('../../support/customWaits'); const { config } = require('../../config/common.conf.js'); -const { defineSupportCode } = require('cucumber'); -defineSupportCode(function ({ And, But, Given, Then, When }) { - const viewOrganisationPage=new ViewOrganisationPage(); - const headerPage = new HeaderPage(); +const viewOrganisationPage=new ViewOrganisationPage(); +const headerPage = new HeaderPage(); - When(/^I click on organisation button$/, { timeout: 600 * 1000 }, async function () { - await headerPage.clickOrganisation(); - const world = this; - await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { - world.attach('Retrying Click Organisation : ' + message); - global.screenShotUtils.takeScreenshot() - .then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }); - await browser.get(config.config.baseUrl + '/organisation'); - - // await headerPage.clickOrganisation(); - }); +When(/^I click on organisation button$/, { timeout: 600 * 1000 }, async function () { + await headerPage.clickOrganisation(); + const world = this; + await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { + world.attach('Retrying Click Organisation : ' + message); + global.screenShotUtils.takeScreenshot() + .then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }); + await browser.get(config.config.baseUrl + '/organisation'); + + // await headerPage.clickOrganisation(); }); +}); - Then(/^I should be on display the name and address details of organisation$/, { timeout: 600 * 1000 }, async function () { - // browser.sleep(LONG_DELAY); - const world = this; - await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { - world.attach('Retrying Click Organisation : ' + message); - global.screenShotUtils.takeScreenshot() - .then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }); - await headerPage.clickOrganisation(); - }); - expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; +Then(/^I should be on display the name and address details of organisation$/, { timeout: 600 * 1000 }, async function () { + // browser.sleep(LONG_DELAY); + const world = this; + await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { + world.attach('Retrying Click Organisation : ' + message); + global.screenShotUtils.takeScreenshot() + .then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }); + await headerPage.clickOrganisation(); }); + expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; +}); - Then(/^I should see name and address details of Organisation$/, async function () { - // browser.sleep(LONG_DELAY); - const world = this; - - await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { - world.attach('Retrying Click Organisation : ' + message); - screenShotUtils.takeScreenshot() - .then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }); - await headerPage.clickOrganisation(); - }); - expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; +Then(/^I should see name and address details of Organisation$/, async function () { + // browser.sleep(LONG_DELAY); + const world = this; + + await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { + world.attach('Retrying Click Organisation : ' + message); + screenShotUtils.takeScreenshot() + .then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }); + await headerPage.clickOrganisation(); }); + expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; }); diff --git a/test/e2e/features/step_definitions/viewUser.steps.js b/test/e2e/features/step_definitions/viewUser.steps.js index df202ee00..c4cb3f002 100644 --- a/test/e2e/features/step_definitions/viewUser.steps.js +++ b/test/e2e/features/step_definitions/viewUser.steps.js @@ -1,3 +1,5 @@ +const { Then, When } = require('@cucumber/cucumber'); + const ViewUserPage = require('../pageObjects/viewUserPage.js'); const HeaderPage = require('../pageObjects/headerPage'); const loginPage = require('../pageObjects/loginLogoutObjects'); @@ -6,48 +8,45 @@ const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../sup const EC = protractor.ExpectedConditions; const { config } = require('../../config/common.conf.js'); -const { defineSupportCode } = require('cucumber'); const browserWaits = require('../../support/customWaits'); -defineSupportCode(function ({ And, But, Given, Then, When }) { - const viewUserPage = new ViewUserPage(); - const headerPage = new HeaderPage(); +const viewUserPage = new ViewUserPage(); +const headerPage = new HeaderPage(); - When(/^I click on user button$/, { timeout: 600 * 1000 }, async function () { - // browser.sleep(LONG_DELAY); - const world = this; +When(/^I click on user button$/, { timeout: 600 * 1000 }, async function () { + // browser.sleep(LONG_DELAY); + const world = this; - await headerPage.clickUser(); + await headerPage.clickUser(); - await browserWaits.retryWithAction(viewUserPage.header, async function (message) { - world.attach('Retrying Click User : ' + message); - const stream = await global.screenShotUtils.takeScreenshot(); - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - await browser.get(config.config.baseUrl+'/users'); - // await headerPage.clickUser(); - }); + await browserWaits.retryWithAction(viewUserPage.header, async function (message) { + world.attach('Retrying Click User : ' + message); + const stream = await global.screenShotUtils.takeScreenshot(); + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + await browser.get(config.config.baseUrl+'/users'); + // await headerPage.clickUser(); + }); - await viewUserPage.amOnPage(); + await viewUserPage.amOnPage(); - // browser.sleep(AMAZING_DELAY); - }); + // browser.sleep(AMAZING_DELAY); +}); - Then(/^I should be on display the user details$/, async function () { - // browser.sleep(AMAZING_DELAY); - expect(await viewUserPage.amOnPage()).to.be.true; - // browser.sleep(LONG_DELAY); - }); +Then(/^I should be on display the user details$/, async function () { + // browser.sleep(AMAZING_DELAY); + expect(await viewUserPage.amOnPage()).to.be.true; + // browser.sleep(LONG_DELAY); +}); - Then('I should see invited user is listed in users table', { timeout: 300 * 1000 }, async function () { - await viewUserPage.validateUserWithEmailListed(global.latestInvitedUser); - }); +Then('I should see invited user is listed in users table', { timeout: 300 * 1000 }, async function () { + await viewUserPage.validateUserWithEmailListed(global.latestInvitedUser); +}); - Then('I should see all user details displayed in table', async function () { - await viewUserPage.validateUsersTableDisplaysAllDetails(); - }); +Then('I should see all user details displayed in table', async function () { + await viewUserPage.validateUsersTableDisplaysAllDetails(); +}); - Then('I should see no empty cells in table', async function () { - await viewUserPage.validateTableHasNoEmptyCells(); - }); +Then('I should see no empty cells in table', async function () { + await viewUserPage.validateTableHasNoEmptyCells(); }); diff --git a/test/e2e/support/hooks.js b/test/e2e/support/hooks.js index ab5692b83..0962af941 100644 --- a/test/e2e/support/hooks.js +++ b/test/e2e/support/hooks.js @@ -1,6 +1,6 @@ 'use strict'; -const Cucumber = require('cucumber'); -const { defineSupportCode } = require('cucumber'); +const { Before, After } = require('@cucumber/cucumber'); + const fs = require('fs'); const mkdirp = require('mkdirp'); const conf = require('../config/common.conf').config; @@ -13,10 +13,9 @@ const htmlReports = `${process.cwd()}/reports/html`; // var xmlReports = process.cwd() + "/reports/xml"; const targetJson = `${jsonReports}/cucumber_report.json`; // var targetXML = xmlReports + "/cucumber_report.xml"; -const { Given, When, Then } = require('cucumber'); +const { Given, When, Then } = require('@cucumber/cucumber'); const CucumberReportLogger = require('./reportLogger'); -// defineSupportCode(function({After }) { // registerHandler("BeforeFeature", { timeout: 500 * 1000 }, function() { // var origFn = browser.driver.controlFlow().execute; // @@ -91,38 +90,36 @@ const CucumberReportLogger = require('./reportLogger'); // }); -defineSupportCode(({ Before, After }) => { - Before(function (scenario, done){ - const world = this; - CucumberReportLogger.setScenarioWorld(world); - done(); - }); +Before(function (scenario, done){ + const world = this; + CucumberReportLogger.setScenarioWorld(world); + done(); +}); - After(function(scenario, done) { - const world = this; - if (scenario.result.status === 'failed') { - screenShotUtils.takeScreenshot().then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }) - .then(() => { - browser.manage().logs().get('browser').then(function (browserLog) { - // console.log('log: ' + require('util').inspect(browserLog)); - const browserErrorLogs = []; - for (let browserLogCounter = 0; browserLogCounter < browserLog.length; browserLogCounter++){ - if (browserLog[browserLogCounter].level.value > 900){ - browserErrorLogs.push(browserLog[browserLogCounter]); - } +After(function(scenario, done) { + const world = this; + if (scenario.result.status === 'failed') { + screenShotUtils.takeScreenshot().then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }) + .then(() => { + browser.manage().logs().get('browser').then(function (browserLog) { + // console.log('log: ' + require('util').inspect(browserLog)); + const browserErrorLogs = []; + for (let browserLogCounter = 0; browserLogCounter < browserLog.length; browserLogCounter++){ + if (browserLog[browserLogCounter].level.value > 900){ + browserErrorLogs.push(browserLog[browserLogCounter]); } - // world.attach(JSON.stringify(browserLog, null, 2)); + } + // world.attach(JSON.stringify(browserLog, null, 2)); - world.attach(JSON.stringify(browserErrorLogs, null, 2)); - // scenario.attach(scenario); - done(); - }); + world.attach(JSON.stringify(browserErrorLogs, null, 2)); + // scenario.attach(scenario); + done(); }); - } else { - done(); - } - }); + }); + } else { + done(); + } }); diff --git a/test/e2e/support/timeout.js b/test/e2e/support/timeout.js index 9c4127ad9..72bff79df 100644 --- a/test/e2e/support/timeout.js +++ b/test/e2e/support/timeout.js @@ -1,5 +1,5 @@ // timeout.js -const { setDefaultTimeout } = require('cucumber'); +const { setDefaultTimeout } = require('@cucumber/cucumber'); setDefaultTimeout(600 * 1000); // this timeout value is global setting impact all step definition function, // thus it doesn't means the value is more large more better. diff --git a/test/e2e/support/world.js b/test/e2e/support/world.js index ffc34d0a3..008fb2c76 100644 --- a/test/e2e/support/world.js +++ b/test/e2e/support/world.js @@ -1,10 +1,10 @@ const { expect, assert } = require('chai'); const config = require('./config'); -const { setWorldConstructor } = require('cucumber'); +const { setWorldConstructor } = require('@cucumber/cucumber'); const minimist = require('minimist'); const argv = minimist(process.argv.slice(2)); -const { setDefaultTimeout } = require('cucumber'); +const { setDefaultTimeout } = require('@cucumber/cucumber'); setDefaultTimeout(60 * 1000); diff --git a/test_codecept/e2e/features/step_definitions/acceptTermsAndConditions.steps.js b/test_codecept/e2e/features/step_definitions/acceptTermsAndConditions.steps.js index b119d967e..daf08eafc 100644 --- a/test_codecept/e2e/features/step_definitions/acceptTermsAndConditions.steps.js +++ b/test_codecept/e2e/features/step_definitions/acceptTermsAndConditions.steps.js @@ -1,33 +1,30 @@ - const acceptTermsAndConditionsPage = require('../pageObjects/termsAndConditionsConfirmPage'); const HeaderPage = require('../pageObjects/headerPage'); const { config } = require('../../config/common.conf'); const browserWaits = require('../../support/customWaits'); -const { defineSupportCode } = require('cucumber'); - - const headerPage = new HeaderPage(); - Then('I am on Accept Terms and Conditions page', async function () { - const world = this; - if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()){ - await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); - expect(await acceptTermsAndConditionsPage.amOnPage()).to.be.true; - } else { - world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js. Validating Home page displayed'); - await headerPage.waitForPrimaryNavigationToDisplay(); - } - }); +const headerPage = new HeaderPage(); +Then('I am on Accept Terms and Conditions page', async function () { + const world = this; + if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()){ + await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); + expect(await acceptTermsAndConditionsPage.amOnPage()).to.be.true; + } else { + world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js. Validating Home page displayed'); + await headerPage.waitForPrimaryNavigationToDisplay(); + } +}); - When('I click Confirm in Accept Terms and Conditions page', async function () { - const world = this; - if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()) { - await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); - await acceptTermsAndConditionsPage.acceptTremsAndConditions(); - await headerPage.waitForPrimaryNavigationToDisplay(); - } else { - world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js.Validating Home page displayed'); - await headerPage.waitForPrimaryNavigationToDisplay(); - } - }); +When('I click Confirm in Accept Terms and Conditions page', async function () { + const world = this; + if (await acceptTermsAndConditionsPage.isFeatureToggleEnabled()) { + await browserWaits.waitForElement(acceptTermsAndConditionsPage.accepttermsAndConditionsContainer); + await acceptTermsAndConditionsPage.acceptTremsAndConditions(); + await headerPage.waitForPrimaryNavigationToDisplay(); + } else { + world.attach('Accept Terms and Conditions feature disabled in config. ../../config/common.conf.js.Validating Home page displayed'); + await headerPage.waitForPrimaryNavigationToDisplay(); + } +}); diff --git a/test_codecept/e2e/features/step_definitions/approveOrg.steps.js b/test_codecept/e2e/features/step_definitions/approveOrg.steps.js index d38545d71..6474bfa15 100644 --- a/test_codecept/e2e/features/step_definitions/approveOrg.steps.js +++ b/test_codecept/e2e/features/step_definitions/approveOrg.steps.js @@ -3,21 +3,19 @@ const approveOrganizationService = require('../pageObjects/approveOrganizationSe const mailinatorService = require('../pageObjects/mailinatorService'); -const { defineSupportCode } = require('cucumber'); +When('I approve organisation', async function () { + await approveOrganizationService.init(); + await approveOrganizationService.approveOrg(global.latestOrgCreated); + await approveOrganizationService.destroy(); +},); - When('I approve organisation', async function () { - await approveOrganizationService.init(); - await approveOrganizationService.approveOrg(global.latestOrgCreated); - await approveOrganizationService.destroy(); - },); - - When('I activate approved organisation super user', async function () { - await mailinatorService.init(); - mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - await mailinatorService.openRegistrationEmailForUser(global.latestOrgSuperUser); - await mailinatorService.completeUserRegistrationFromEmail(); - await mailinatorService.destroy(); - }); +When('I activate approved organisation super user', async function () { + await mailinatorService.init(); + mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + await mailinatorService.openRegistrationEmailForUser(global.latestOrgSuperUser); + await mailinatorService.completeUserRegistrationFromEmail(); + await mailinatorService.destroy(); +}); function logger(world, message, isScreenshot) { diff --git a/test_codecept/e2e/features/step_definitions/createOrganisation.steps.js b/test_codecept/e2e/features/step_definitions/createOrganisation.steps.js index 9e693c418..de4e9bfee 100644 --- a/test_codecept/e2e/features/step_definitions/createOrganisation.steps.js +++ b/test_codecept/e2e/features/step_definitions/createOrganisation.steps.js @@ -1,7 +1,7 @@ 'use strict'; + const CreateOrganisationObjects = require('../pageObjects/createOrganisationObjects'); -const { defineSupportCode } = require('cucumber'); const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); const { config } = require('../../config/common.conf.js'); const approveOrganizationService = require('../pageObjects/approveOrganizationService'); @@ -13,263 +13,263 @@ async function waitForElement(el) { await elementToWait.wait() } - const createOrganisationObject = new CreateOrganisationObjects(); - - When(/^I navigate to EUI Manage Organisation Url$/, async function () { - await browser.driver.manage().deleteAllCookies(); - await browser.get(config.config.baseUrl + '/register-org/register'); - browser.sleep(MID_DELAY); - }); - - When(/^I navigate to EUI Register Organisation Url$/, async function () { - await browser.driver.manage().deleteAllCookies(); - await browser.get(config.config.baseUrl + '/register-org/register'); - browser.sleep(MID_DELAY); - }); - - Then('I am on Register organisation start page', async function () { - await createOrganisationObject.waitForStartRegisterPage(); - await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; - await expect(await createOrganisationObject.start_button.getText(), 'Start button text not mathing with expected') - .to - .includes('Start'); - }); - - Then(/^I land on register organisation page and continue$/, async function () { - // await waitForElement('govuk-heading-xl'); - - await BrowserWaits.retryWithActionCallback(async () => { - try { - await BrowserWaits.waitForElement($('.govuk-heading-xl')); - await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; - await expect(createOrganisationObject.start_button.getText()) - .to - .eventually - .include('Start'); - await createOrganisationObject.start_button.click(); - await createOrganisationObject.waitForPage("What's the name of your organisation?"); - - } catch (err){ - await browser.get(config.config.baseUrl + '/register-org/register'); - throw new Error(err); - } - }); - }); - - Then(/^I Enter the Organization name$/, async function () { - // await waitForElement('govuk-heading-xl'); - await expect(createOrganisationObject.org_name.isDisplayed(), 'Input Organisation name nor present').to.eventually.be.true; - await createOrganisationObject.enterOrgName(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I Enter the Office Address details$/, async function () { - // await waitForElement(createOrganisationObject.officeAddressOne); - await expect(createOrganisationObject.officeAddressOne.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.officeAddressOne.sendKeys('1, Cliffinton'); - // browser.sleep(MID_DELAY); - await expect(createOrganisationObject.townName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.townName.sendKeys('London'); - await expect(createOrganisationObject.postcode.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.postcode.sendKeys('SE15TY'); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I Enter the PBA1 and PBA2 details$/, async function () { - // await waitForElement('govuk-heading-xl'); - browser.sleep(MID_DELAY); - await createOrganisationObject.PBAnumber1.isDisplayed(); - await createOrganisationObject.enterPBANumber(); - // await createOrganisationObject.PBAnumber2.isDisplayed(); - // await createOrganisationObject.enterPBA2Number(); - await createOrganisationObject.continue_button.click(); - browser.sleep(MID_DELAY); - }); - - Then(/^I Enter the DX Reference details$/, async function () { - await createOrganisationObject.clickDXreferenceCheck(); - browser.sleep(MID_DELAY); - await createOrganisationObject.DXNumber.isDisplayed(); - await createOrganisationObject.enterDXNumber(); - await createOrganisationObject.DXexchange.isDisplayed(); - await createOrganisationObject.enterDXENumber(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I Select and Enter the SRA number$/, async function () { - // await waitForElement('govuk-heading-xl'); - //await expect(createOrganisationObject.SRACheckBox.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.clickSRAreferenceCheck(); - // browser.sleep(MID_DELAY); - // await waitForElement('govuk-heading-xl'); - await expect(createOrganisationObject.SRANumber.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.enterSRANumber(); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I Enter the firstName and lastName$/, async function () { - await waitForElement('govuk-heading-xl'); - expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.firstName.sendKeys('Mario'); - expect(createOrganisationObject.lastName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.lastName.sendKeys('Perta'); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I Enter the Email Address$/, async function () { - // await waitForElement('govuk-heading-xl'); - await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; - - global.latestOrgSuperUser = Math.random().toString(36).substring(2) + '@mailinator.com'; - global.latestOrgSuperUserPassword = 'Monday01'; - - await createOrganisationObject.enterEmailAddress(global.latestOrgSuperUser); - await createOrganisationObject.continue_button.click(); - - // browser.sleep(MID_DELAY); - }); - - Then(/^I land on the summary page and check submit$/, async function () { - // browser.sleep(MID_DELAY); - // await waitForElement('govuk-heading-l'); - - await expect(createOrganisationObject.submit_button.isDisplayed()).to.eventually.be.true; - await expect(await createOrganisationObject.submit_button.getText()) - .to - .includes('Confirm and submit details'); - await createOrganisationObject.submit_button.click(); - }); - - Then(/^I created the organisation successfully$/, async function () { - // browser.sleep(MID_DELAY); - await createOrganisationObject.waitForSubmission(); - await expect(createOrganisationObject.org_success_heading.isDisplayed()).to.eventually.be.true; - await expect(await createOrganisationObject.org_success_heading.getText()) - .to - .includes('Registration details submitted'); - }); - - When(/^I am not entered Organization name$/, async function () { - createOrganisationObject.org_name.sendKeys(''); - await createOrganisationObject.continue_button.click(); - browser.sleep(MID_DELAY); - }); - - Then(/^I should be display organization error$/, async function () { - await expect(createOrganisationObject.org_failure_error_heading.isDisplayed()).to.eventually.be.true; - await expect(await createOrganisationObject.org_failure_error_heading.getText()) - .to - .includes('There is a problem'); - }); - - When(/^I am not entered the Office Address details$/, async function () { - await createOrganisationObject.officeAddressOne.sendKeys(''); - await createOrganisationObject.townName.sendKeys(''); - await createOrganisationObject.postcode.sendKeys(''); - await createOrganisationObject.continue_button.click(); - // browser.sleep(LONG_DELAY); - }); - Then(/^I should be display Office Address error$/, async function () { - await expect(createOrganisationObject.off_address_error_heading.isDisplayed()).to.eventually.be.true; - await expect(await createOrganisationObject.off_address_error_heading.getText()) - .to - .includes('There is a problem'); - }); - - When(/^I am not entered SRA number$/, async function () { - await createOrganisationObject.clickSRAreferenceCheck(); - await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); - await createOrganisationObject.SRANumber.sendKeys(''); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I should be display SRA error$/, async function () { - await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); - await expect(await createOrganisationObject.sra_error_heading.getText()) - .to - .includes('There is a problem'); - }); - - When(/^I am not entered the email address$/, async function () { - await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.emailAddr.sendKeys(''); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I should be display email error$/, async function () { - await expect(createOrganisationObject.email_error_heading.isDisplayed()).to.eventually.be.true; - await expect(await createOrganisationObject.email_error_heading.getText()) - .to - .includes('There is a problem'); - }); - - When(/^I Enter the invalid PBA1 and PBA2 details$/, async function () { - await expect(createOrganisationObject.PBAnumber1.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.PBAnumber1.sendKeys(1234455558); - // await createOrganisationObject.PBAnumber2.sendKeys(1233334988); - await createOrganisationObject.continue_button.click(); - // browser.sleep(LONG_DELAY); - }); - - Then(/^I should be display PBA error$/, async function () { - await expect(createOrganisationObject.pba_error_heading.isDisplayed()).to.eventually.be.true; - await expect(await createOrganisationObject.pba_error_heading.getText()) - .to - .includes('There is a problem'); - }); - - When(/^I am not entered the firstName and lastName$/, async function () { - await expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; - await createOrganisationObject.firstName.sendKeys(''); - await createOrganisationObject.lastName.sendKeys(''); - await createOrganisationObject.continue_button.click(); - // browser.sleep(MID_DELAY); - }); - - Then(/^I should be display firstName and lastName error$/, async function () { - await expect(createOrganisationObject.name_error_heading.isDisplayed()).to.eventually.be.true; - await expect(await createOrganisationObject.name_error_heading.getText()) - .to - .includes('There is a problem'); - }); - - When('I am on page {string} in registration step', async function (page) { - await createOrganisationObject.waitForPage(page); - }); - - Then('I see content header already registered account', function () { - expect(createOrganisationObject.getAlreadyRegisteredAccountHeaderText()).to - .eventually. - equal('Already registered for a MyHMCTS account?'); - }); - - Then('I see manage cases link under already registered account header', function () { - expect(createOrganisationObject.isManageCasesLinkPresent()).to - .eventually. - be.true; - }); - - Then('I see manage org link under already registered account header', async function () { - expect(await createOrganisationObject.isManageOrgLinkPresent()).to - .be.true; - }); - - Then('I click and validate MC link opens in new tab', async function () { - await createOrganisationObject.clickAndValidateMCLink(); - }); - - Then('I click and validate MO link opens in new tab', async function () { - await createOrganisationObject.clickAndValidateMOLink(); - }); - - When('I click back link in register org workflow', async function () { - await createOrganisationObject.clickBackLink(); - }); +const createOrganisationObject = new CreateOrganisationObjects(); + +When(/^I navigate to EUI Manage Organisation Url$/, async function () { + await browser.driver.manage().deleteAllCookies(); + await browser.get(config.config.baseUrl + '/register-org/register'); + browser.sleep(MID_DELAY); +}); + +When(/^I navigate to EUI Register Organisation Url$/, async function () { + await browser.driver.manage().deleteAllCookies(); + await browser.get(config.config.baseUrl + '/register-org/register'); + browser.sleep(MID_DELAY); +}); + +Then('I am on Register organisation start page', async function () { + await createOrganisationObject.waitForStartRegisterPage(); + await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; + await expect(await createOrganisationObject.start_button.getText(), 'Start button text not mathing with expected') + .to + .includes('Start'); +}); + +Then(/^I land on register organisation page and continue$/, async function () { + // await waitForElement('govuk-heading-xl'); + + await BrowserWaits.retryWithActionCallback(async () => { + try { + await BrowserWaits.waitForElement($('.govuk-heading-xl')); + await expect(createOrganisationObject.start_button.isDisplayed(), 'Create Organisation START button not present').to.eventually.be.true; + await expect(createOrganisationObject.start_button.getText()) + .to + .eventually + .include('Start'); + await createOrganisationObject.start_button.click(); + await createOrganisationObject.waitForPage("What's the name of your organisation?"); + + } catch (err){ + await browser.get(config.config.baseUrl + '/register-org/register'); + throw new Error(err); + } + }); +}); + +Then(/^I Enter the Organization name$/, async function () { + // await waitForElement('govuk-heading-xl'); + await expect(createOrganisationObject.org_name.isDisplayed(), 'Input Organisation name nor present').to.eventually.be.true; + await createOrganisationObject.enterOrgName(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I Enter the Office Address details$/, async function () { + // await waitForElement(createOrganisationObject.officeAddressOne); + await expect(createOrganisationObject.officeAddressOne.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.officeAddressOne.sendKeys('1, Cliffinton'); + // browser.sleep(MID_DELAY); + await expect(createOrganisationObject.townName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.townName.sendKeys('London'); + await expect(createOrganisationObject.postcode.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.postcode.sendKeys('SE15TY'); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I Enter the PBA1 and PBA2 details$/, async function () { + // await waitForElement('govuk-heading-xl'); + browser.sleep(MID_DELAY); + await createOrganisationObject.PBAnumber1.isDisplayed(); + await createOrganisationObject.enterPBANumber(); + // await createOrganisationObject.PBAnumber2.isDisplayed(); + // await createOrganisationObject.enterPBA2Number(); + await createOrganisationObject.continue_button.click(); + browser.sleep(MID_DELAY); +}); + +Then(/^I Enter the DX Reference details$/, async function () { + await createOrganisationObject.clickDXreferenceCheck(); + browser.sleep(MID_DELAY); + await createOrganisationObject.DXNumber.isDisplayed(); + await createOrganisationObject.enterDXNumber(); + await createOrganisationObject.DXexchange.isDisplayed(); + await createOrganisationObject.enterDXENumber(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I Select and Enter the SRA number$/, async function () { + // await waitForElement('govuk-heading-xl'); + //await expect(createOrganisationObject.SRACheckBox.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.clickSRAreferenceCheck(); + // browser.sleep(MID_DELAY); + // await waitForElement('govuk-heading-xl'); + await expect(createOrganisationObject.SRANumber.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.enterSRANumber(); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I Enter the firstName and lastName$/, async function () { + await waitForElement('govuk-heading-xl'); + expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.firstName.sendKeys('Mario'); + expect(createOrganisationObject.lastName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.lastName.sendKeys('Perta'); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I Enter the Email Address$/, async function () { + // await waitForElement('govuk-heading-xl'); + await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; + + global.latestOrgSuperUser = Math.random().toString(36).substring(2) + '@mailinator.com'; + global.latestOrgSuperUserPassword = 'Monday01'; + + await createOrganisationObject.enterEmailAddress(global.latestOrgSuperUser); + await createOrganisationObject.continue_button.click(); + + // browser.sleep(MID_DELAY); +}); + +Then(/^I land on the summary page and check submit$/, async function () { + // browser.sleep(MID_DELAY); + // await waitForElement('govuk-heading-l'); + + await expect(createOrganisationObject.submit_button.isDisplayed()).to.eventually.be.true; + await expect(await createOrganisationObject.submit_button.getText()) + .to + .includes('Confirm and submit details'); + await createOrganisationObject.submit_button.click(); +}); + +Then(/^I created the organisation successfully$/, async function () { + // browser.sleep(MID_DELAY); + await createOrganisationObject.waitForSubmission(); + await expect(createOrganisationObject.org_success_heading.isDisplayed()).to.eventually.be.true; + await expect(await createOrganisationObject.org_success_heading.getText()) + .to + .includes('Registration details submitted'); +}); + +When(/^I am not entered Organization name$/, async function () { + createOrganisationObject.org_name.sendKeys(''); + await createOrganisationObject.continue_button.click(); + browser.sleep(MID_DELAY); +}); + +Then(/^I should be display organization error$/, async function () { + await expect(createOrganisationObject.org_failure_error_heading.isDisplayed()).to.eventually.be.true; + await expect(await createOrganisationObject.org_failure_error_heading.getText()) + .to + .includes('There is a problem'); +}); + +When(/^I am not entered the Office Address details$/, async function () { + await createOrganisationObject.officeAddressOne.sendKeys(''); + await createOrganisationObject.townName.sendKeys(''); + await createOrganisationObject.postcode.sendKeys(''); + await createOrganisationObject.continue_button.click(); + // browser.sleep(LONG_DELAY); +}); +Then(/^I should be display Office Address error$/, async function () { + await expect(createOrganisationObject.off_address_error_heading.isDisplayed()).to.eventually.be.true; + await expect(await createOrganisationObject.off_address_error_heading.getText()) + .to + .includes('There is a problem'); +}); + +When(/^I am not entered SRA number$/, async function () { + await createOrganisationObject.clickSRAreferenceCheck(); + await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); + await createOrganisationObject.SRANumber.sendKeys(''); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I should be display SRA error$/, async function () { + await createOrganisationObject.waitForPage('Enter your organisation SRA ID'); + await expect(await createOrganisationObject.sra_error_heading.getText()) + .to + .includes('There is a problem'); +}); + +When(/^I am not entered the email address$/, async function () { + await expect(createOrganisationObject.emailAddr.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.emailAddr.sendKeys(''); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I should be display email error$/, async function () { + await expect(createOrganisationObject.email_error_heading.isDisplayed()).to.eventually.be.true; + await expect(await createOrganisationObject.email_error_heading.getText()) + .to + .includes('There is a problem'); +}); + +When(/^I Enter the invalid PBA1 and PBA2 details$/, async function () { + await expect(createOrganisationObject.PBAnumber1.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.PBAnumber1.sendKeys(1234455558); + // await createOrganisationObject.PBAnumber2.sendKeys(1233334988); + await createOrganisationObject.continue_button.click(); + // browser.sleep(LONG_DELAY); +}); + +Then(/^I should be display PBA error$/, async function () { + await expect(createOrganisationObject.pba_error_heading.isDisplayed()).to.eventually.be.true; + await expect(await createOrganisationObject.pba_error_heading.getText()) + .to + .includes('There is a problem'); +}); + +When(/^I am not entered the firstName and lastName$/, async function () { + await expect(createOrganisationObject.firstName.isDisplayed()).to.eventually.be.true; + await createOrganisationObject.firstName.sendKeys(''); + await createOrganisationObject.lastName.sendKeys(''); + await createOrganisationObject.continue_button.click(); + // browser.sleep(MID_DELAY); +}); + +Then(/^I should be display firstName and lastName error$/, async function () { + await expect(createOrganisationObject.name_error_heading.isDisplayed()).to.eventually.be.true; + await expect(await createOrganisationObject.name_error_heading.getText()) + .to + .includes('There is a problem'); +}); + +When('I am on page {string} in registration step', async function (page) { + await createOrganisationObject.waitForPage(page); +}); + +Then('I see content header already registered account', function () { + expect(createOrganisationObject.getAlreadyRegisteredAccountHeaderText()).to + .eventually. + equal('Already registered for a MyHMCTS account?'); +}); + +Then('I see manage cases link under already registered account header', function () { + expect(createOrganisationObject.isManageCasesLinkPresent()).to + .eventually. + be.true; +}); + +Then('I see manage org link under already registered account header', async function () { + expect(await createOrganisationObject.isManageOrgLinkPresent()).to + .be.true; +}); + +Then('I click and validate MC link opens in new tab', async function () { + await createOrganisationObject.clickAndValidateMCLink(); +}); + +Then('I click and validate MO link opens in new tab', async function () { + await createOrganisationObject.clickAndValidateMOLink(); +}); + +When('I click back link in register org workflow', async function () { + await createOrganisationObject.clickBackLink(); +}); diff --git a/test_codecept/e2e/features/step_definitions/dataSetUp.steps.js b/test_codecept/e2e/features/step_definitions/dataSetUp.steps.js index a0d2c440a..d44d0e866 100644 --- a/test_codecept/e2e/features/step_definitions/dataSetUp.steps.js +++ b/test_codecept/e2e/features/step_definitions/dataSetUp.steps.js @@ -1,57 +1,55 @@ 'use strict'; const CreateOrganisationObjects = require('../pageObjects/createOrganisationObjects'); -const { defineSupportCode } = require('cucumber'); const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); const { config } = require('../../config/common.conf.js'); const approveOrganizationService = require('../pageObjects/approveOrganizationService'); const mailinatorService = require('../pageObjects/mailinatorService'); +const createOrganisationObject = new CreateOrganisationObjects(); - const createOrganisationObject = new CreateOrganisationObjects(); - - Given('I create test read write organisation', async function () { - if (global.testorgStatus >= 1){ - return; - } - global.TestOrg_rw_name = 'AUTOTEST_RW_' + Date.now(); - global.testorg_rw_superuser_email = 'autotest_user' + Date.now() + '@mailinator.com'; +Given('I create test read write organisation', async function () { + if (global.testorgStatus >= 1){ + return; + } + global.TestOrg_rw_name = 'AUTOTEST_RW_' + Date.now(); + global.testorg_rw_superuser_email = 'autotest_user' + Date.now() + '@mailinator.com'; - await browser.get(config.config.baseUrl + '/register-org/register'); - await createOrganisationObject.createOrganisation(global.TestOrg_rw_name, global.testorg_rw_superuser_email); + await browser.get(config.config.baseUrl + '/register-org/register'); + await createOrganisationObject.createOrganisation(global.TestOrg_rw_name, global.testorg_rw_superuser_email); - global.testorgStatus = '1'; - }); + global.testorgStatus = '1'; +}); - Given('I approve test read write organisation', async function () { - if (global.testorgStatus >= 2) { - return; - } - await approveOrganizationService.init(); - try { - await approveOrganizationService.approveOrg(global.TestOrg_rw_name); - global.testorgStatus = '2'; - await approveOrganizationService.destroy(); - } catch (err){ - this.attach('Error occured Approving organisation'); - await approveOrganizationService.destroy(); - logger(this, await approveOrganizationService.getScrenshot(), true); - await approveOrganizationService.destroy(); - throw err; - } - }); +Given('I approve test read write organisation', async function () { + if (global.testorgStatus >= 2) { + return; + } + await approveOrganizationService.init(); + try { + await approveOrganizationService.approveOrg(global.TestOrg_rw_name); + global.testorgStatus = '2'; + await approveOrganizationService.destroy(); + } catch (err){ + this.attach('Error occured Approving organisation'); + await approveOrganizationService.destroy(); + logger(this, await approveOrganizationService.getScrenshot(), true); + await approveOrganizationService.destroy(); + throw err; + } +}); - When('I activate test read write approved organisation super user', async function () { - if (global.testorgStatus >= 3) { - return; - } - await mailinatorService.init(); - mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - await mailinatorService.openRegistrationEmailForUser(global.testorg_rw_superuser_email); - await mailinatorService.completeUserRegistrationFromEmail(); - await mailinatorService.destroy(); - global.testorgStatus = '3'; - }); +When('I activate test read write approved organisation super user', async function () { + if (global.testorgStatus >= 3) { + return; + } + await mailinatorService.init(); + mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + await mailinatorService.openRegistrationEmailForUser(global.testorg_rw_superuser_email); + await mailinatorService.completeUserRegistrationFromEmail(); + await mailinatorService.destroy(); + global.testorgStatus = '3'; +}); function logger(world, message, isScreenshot) { diff --git a/test_codecept/e2e/features/step_definitions/inviteUser.steps.js b/test_codecept/e2e/features/step_definitions/inviteUser.steps.js index aba7cc38e..a510b0f5d 100644 --- a/test_codecept/e2e/features/step_definitions/inviteUser.steps.js +++ b/test_codecept/e2e/features/step_definitions/inviteUser.steps.js @@ -1,3 +1,4 @@ + const loginPage = require('../pageObjects/loginLogoutObjects'); const HeaderPage = require('../pageObjects/headerPage'); const ViewUserPage = require('../pageObjects/viewUserPage.js'); @@ -5,172 +6,170 @@ const InviteUserPage = require('../pageObjects/inviteUserPage.js'); const TestData = require('../../utils/TestData.js'); const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); -Dropdown = require('../pageObjects/webdriver-components/dropdown.js'); -TextField = require('../pageObjects/webdriver-components/textField.js'); +const Dropdown = require('../pageObjects/webdriver-components/dropdown.js'); +const TextField = require('../pageObjects/webdriver-components/textField.js'); const { config } = require('../../config/common.conf.js'); const mailinatorService = require('../pageObjects/mailinatorService'); const browserWaits = require('../../support/customWaits'); const CucumberReportLogger = require('../../support/reportLogger'); -const { defineSupportCode } = require('cucumber'); const cucumberHtmlReporter = require('cucumber-html-reporter'); const { Error } = require('globalthis/implementation'); +const inviteUserPage=new InviteUserPage(); +const viewUserPage=new ViewUserPage(); +const headerPage = new HeaderPage(); + +const invitedUserEmail = ''; + +When(/^I click on invite user button$/, async function () { + await viewUserPage.clickInviteUser(); + // browser.sleep(LONG_DELAY); +}); + +When(/^I navigate to invite user page$/, async function () { + const inviteUserPath = config.config.baseUrl.endsWith('/') ? 'users/invite-user' : '/users/invite-user'; + await browser.get(config.config.baseUrl + inviteUserPath); + await inviteUserPage.waitForPage(); +}); + +Then(/^I should be on display invite user page$/, async function () { + // browser.sleep(AMAZING_DELAY);; + await inviteUserPage.waitForPage(); + expect(await inviteUserPage.amOnPage(), 'Invite User page is not displayed').to.be.true; +}); + +When(/^I enter mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { + await inviteUserPage.waitForPage(); + await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); + await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); + + // var emailAddress =Math.random().toString(36).substring(2); + global.latestInvitedUser = Math.random().toString(36).substring(2)+'@mailinator.com'; + global.latestInvitedUserPassword = 'Monday01'; + + await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); + await inviteUserPage.manageUserCheckbox.click(); + browser.sleep(LONG_DELAY); + await inviteUserPage.clickSendInvitationButton(); + // browser.sleep(LONG_DELAY); +}); +Then(/^user should be created successfuly$/, async function () { + + await browserWaits.waitForElement(inviteUserPage.userInvitaionConfirmation) + await browserWaits.retryWithActionCallback(async () => { + expect(await inviteUserPage.userInvitaionConfirmation.getText()).to.include('You\'ve invited'); + + }) +}); + +When(/^I not enter the mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { + await inviteUserPage.enterIntoTextFieldFirstName(''); + await inviteUserPage.enterIntoTextFieldLastName(''); + await inviteUserPage.enterIntoTextFieldEmailAddress(''); + await inviteUserPage.clickSendInvitationButton(); +}); + +When('I enter mandatory fields firstname,lastname,emailaddress with permissions and click on send invitation button', async function (table) { + await inviteUserPage.waitForPage(); + await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); + await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); + global.latestInvitedUser = Math.random().toString(36).substring(2) + '@mailinator.com'; + global.latestInvitedUserPassword = 'Monday01'; + + await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); + const permissions = table.parse().hashes(); + for (let permCounter = 0; permCounter < permissions.length; permCounter++){ + await inviteUserPage.selectPermission(permissions[permCounter].Permission, true); + } + await inviteUserPage.clickSendInvitationButton(); +}); - const inviteUserPage=new InviteUserPage(); - const viewUserPage=new ViewUserPage(); - const headerPage = new HeaderPage(); - - const invitedUserEmail = ''; - - When(/^I click on invite user button$/, async function () { - await viewUserPage.clickInviteUser(); - // browser.sleep(LONG_DELAY); - }); - - When(/^I navigate to invite user page$/, async function () { - const inviteUserPath = config.config.baseUrl.endsWith('/') ? 'users/invite-user' : '/users/invite-user'; - await browser.get(config.config.baseUrl + inviteUserPath); - await inviteUserPage.waitForPage(); - }); - - Then(/^I should be on display invite user page$/, async function () { - // browser.sleep(AMAZING_DELAY);; - await inviteUserPage.waitForPage(); - expect(await inviteUserPage.amOnPage(), 'Invite User page is not displayed').to.be.true; - }); - - When(/^I enter mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { - await inviteUserPage.waitForPage(); - await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); - await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); - - // var emailAddress =Math.random().toString(36).substring(2); - global.latestInvitedUser = Math.random().toString(36).substring(2)+'@mailinator.com'; - global.latestInvitedUserPassword = 'Monday01'; - - await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); - await inviteUserPage.manageUserCheckbox.click(); - browser.sleep(LONG_DELAY); - await inviteUserPage.clickSendInvitationButton(); - // browser.sleep(LONG_DELAY); - }); - Then(/^user should be created successfuly$/, async function () { - - await browserWaits.waitForElement(inviteUserPage.userInvitaionConfirmation) - await browserWaits.retryWithActionCallback(async () => { - expect(await inviteUserPage.userInvitaionConfirmation.getText()).to.include('You\'ve invited'); - - }) - }); - - When(/^I not enter the mandatory fields firstname,lastname,emailaddress,permissions and click on send invitation button$/, async function () { - await inviteUserPage.enterIntoTextFieldFirstName(''); - await inviteUserPage.enterIntoTextFieldLastName(''); - await inviteUserPage.enterIntoTextFieldEmailAddress(''); - await inviteUserPage.clickSendInvitationButton(); - }); - - When('I enter mandatory fields firstname,lastname,emailaddress with permissions and click on send invitation button', async function (table) { - await inviteUserPage.waitForPage(); - await inviteUserPage.enterIntoTextFieldFirstName(TestData.firstName); - await inviteUserPage.enterIntoTextFieldLastName(TestData.lastName); - global.latestInvitedUser = Math.random().toString(36).substring(2) + '@mailinator.com'; - global.latestInvitedUserPassword = 'Monday01'; - - await inviteUserPage.enterIntoTextFieldEmailAddress(global.latestInvitedUser); - const permissions = table.parse().hashes(); - for (let permCounter = 0; permCounter < permissions.length; permCounter++){ - await inviteUserPage.selectPermission(permissions[permCounter].Permission, true); - } - await inviteUserPage.clickSendInvitationButton(); - }); - - When('I edit user permissions', async function (table) { - const permissions = table.hashes(); - for (let permCounter = 0; permCounter < permissions.length; permCounter++) { - await inviteUserPage.selectPermission(permissions[permCounter].Permission, permissions[permCounter].isSelected === 'true'); - } - }); - - Then(/^I should be display the validation error$/, async function () { - await expect(inviteUserPage.failure_error_heading.isDisplayed()).to.eventually.be.true; - await expect(inviteUserPage.failure_error_heading.getText()) - .to - .eventually - .equal('There is a problem'); - }); - - When(/^I click on back button$/, async function () { - // browser.sleep(AMAZING_DELAY); - await inviteUserPage.clickBackButton(); - }); - - Then('I activate invited user', async function () { - await mailinatorService.init(); - try { - mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); - await mailinatorService.openRegistrationEmailForUser(global.latestInvitedUser); - this.attach('Registration email received successfully.'); - await mailinatorService.completeUserRegistrationFromEmail(); - this.attach('Registration completed successfully.'); - await mailinatorService.destroy(); - } catch (err){ - await CucumberReportLogger.AddScreenshot(mailinatorService.getScreenShotUtil()); - await mailinatorService.destroy(); - throw new Error('Error occured during user activation steps', err); - } - }); - - Then(/^I click on a Active User$/, async function () { - await inviteUserPage.findNextActiveUser(); - await browserWaits.waitForElement(inviteUserPage.activeUser) - await expect(inviteUserPage.activeUser.isDisplayed()).to.eventually.be.true; - await inviteUserPage.activeUser.click(); - }); - - Then(/^I see change link and suspend button$/, async function () { - - await browserWaits.waitForElement(inviteUserPage.userDetailsComponent); - await browserWaits.waitForElement(inviteUserPage.changeLink); - await browserWaits.waitForElement(inviteUserPage.suspendButton); - - await expect(inviteUserPage.changeLink.isDisplayed(), 'chnage link not displayed').to.eventually.be.true; - await expect(inviteUserPage.suspendButton.isDisplayed(), 'suspend button not displayed').to.eventually.be.true; - }); - - Then(/^I click on change link$/, async function () { - browser.sleep(MID_DELAY); - await inviteUserPage.changeLink.click(); - await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; - await expect(inviteUserPage.editUserText.getText()) - .to - .eventually - .equal('Edit user'); - }); - - Then(/^I edit the Manage User checkbox and click submit$/, async function () { - browser.sleep(MID_DELAY); - await inviteUserPage.manageUserCheckbox.click(); - await inviteUserPage.clickSendInvitationButton(); - browser.sleep(MID_DELAY); - await viewUserPage.waitForUserDetailsPage(); - await expect(inviteUserPage.suspendButton.isDisplayed()).to.eventually.be.true; - }); - - Then(/^I click the suspend button$/, async function () { - await inviteUserPage.suspendButton.click(); - }); - - Then(/^I see the suspend user page$/, async function () { - browser.sleep(MID_DELAY); - await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; - await expect(inviteUserPage.editUserText.getText()) - .to - .eventually - .equal('Are you sure you want to suspend this account?'); - }); +When('I edit user permissions', async function (table) { + const permissions = table.hashes(); + for (let permCounter = 0; permCounter < permissions.length; permCounter++) { + await inviteUserPage.selectPermission(permissions[permCounter].Permission, permissions[permCounter].isSelected === 'true'); + } +}); + +Then(/^I should be display the validation error$/, async function () { + await expect(inviteUserPage.failure_error_heading.isDisplayed()).to.eventually.be.true; + await expect(inviteUserPage.failure_error_heading.getText()) + .to + .eventually + .equal('There is a problem'); +}); + +When(/^I click on back button$/, async function () { + // browser.sleep(AMAZING_DELAY); + await inviteUserPage.clickBackButton(); +}); + +Then('I activate invited user', async function () { + await mailinatorService.init(); + try { + mailinatorService.setLogger((message, isScreenshot) => logger(this, message, isScreenshot)); + await mailinatorService.openRegistrationEmailForUser(global.latestInvitedUser); + this.attach('Registration email received successfully.'); + await mailinatorService.completeUserRegistrationFromEmail(); + this.attach('Registration completed successfully.'); + await mailinatorService.destroy(); + } catch (err){ + await CucumberReportLogger.AddScreenshot(mailinatorService.getScreenShotUtil()); + await mailinatorService.destroy(); + throw new Error('Error occured during user activation steps', err); + } +}); + +Then(/^I click on a Active User$/, async function () { + await inviteUserPage.findNextActiveUser(); + await browserWaits.waitForElement(inviteUserPage.activeUser) + await expect(inviteUserPage.activeUser.isDisplayed()).to.eventually.be.true; + await inviteUserPage.activeUser.click(); +}); + +Then(/^I see change link and suspend button$/, async function () { + + await browserWaits.waitForElement(inviteUserPage.userDetailsComponent); + await browserWaits.waitForElement(inviteUserPage.changeLink); + await browserWaits.waitForElement(inviteUserPage.suspendButton); + + await expect(inviteUserPage.changeLink.isDisplayed(), 'chnage link not displayed').to.eventually.be.true; + await expect(inviteUserPage.suspendButton.isDisplayed(), 'suspend button not displayed').to.eventually.be.true; +}); + +Then(/^I click on change link$/, async function () { + browser.sleep(MID_DELAY); + await inviteUserPage.changeLink.click(); + await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; + await expect(inviteUserPage.editUserText.getText()) + .to + .eventually + .equal('Edit user'); +}); + +Then(/^I edit the Manage User checkbox and click submit$/, async function () { + browser.sleep(MID_DELAY); + await inviteUserPage.manageUserCheckbox.click(); + await inviteUserPage.clickSendInvitationButton(); + browser.sleep(MID_DELAY); + await viewUserPage.waitForUserDetailsPage(); + await expect(inviteUserPage.suspendButton.isDisplayed()).to.eventually.be.true; +}); + +Then(/^I click the suspend button$/, async function () { + await inviteUserPage.suspendButton.click(); +}); + +Then(/^I see the suspend user page$/, async function () { + browser.sleep(MID_DELAY); + await expect(inviteUserPage.editUserText.isDisplayed()).to.eventually.be.true; + await expect(inviteUserPage.editUserText.getText()) + .to + .eventually + .equal('Are you sure you want to suspend this account?'); +}); function logger(world, message, isScreenshot){ diff --git a/test_codecept/e2e/features/step_definitions/viewOrganisation.steps.js b/test_codecept/e2e/features/step_definitions/viewOrganisation.steps.js index 21d061cf9..1a0b8332d 100644 --- a/test_codecept/e2e/features/step_definitions/viewOrganisation.steps.js +++ b/test_codecept/e2e/features/step_definitions/viewOrganisation.steps.js @@ -1,3 +1,5 @@ + + const ViewOrganisationPage = require('../pageObjects/viewOrganisationPage.js'); const HeaderPage = require('../pageObjects/headerPage'); const loginPage = require('../pageObjects/loginLogoutObjects'); @@ -5,50 +7,49 @@ const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../sup const browserWaits = require('../../support/customWaits'); const { config } = require('../../config/common.conf.js'); -const { defineSupportCode } = require('cucumber'); - const viewOrganisationPage=new ViewOrganisationPage(); - const headerPage = new HeaderPage(); +const viewOrganisationPage=new ViewOrganisationPage(); +const headerPage = new HeaderPage(); - When(/^I click on organisation button$/, async function () { - await headerPage.clickOrganisation(); - const world = this; - await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { - world.attach('Retrying Click Organisation : ' + message); - global.screenShotUtils.takeScreenshot() - .then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }); - await browser.get(config.config.baseUrl + '/organisation'); - - // await headerPage.clickOrganisation(); - }); - }); +When(/^I click on organisation button$/, async function () { + await headerPage.clickOrganisation(); + const world = this; + await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { + world.attach('Retrying Click Organisation : ' + message); + global.screenShotUtils.takeScreenshot() + .then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }); + await browser.get(config.config.baseUrl + '/organisation'); - Then(/^I should be on display the name and address details of organisation$/, async function () { - // browser.sleep(LONG_DELAY); - const world = this; - await browserWaits.retryWithActionCallback( async function (message) { - await headerPage.clickOrganisation(); - await browserWaits.waitForElement(viewOrganisationPage.header) - }); - expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; + // await headerPage.clickOrganisation(); }); +}); - Then(/^I should see name and address details of Organisation$/, async function () { - // browser.sleep(LONG_DELAY); - const world = this; - - await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { - world.attach('Retrying Click Organisation : ' + message); - screenShotUtils.takeScreenshot() - .then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }); - await headerPage.clickOrganisation(); - }); - expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; +Then(/^I should be on display the name and address details of organisation$/, async function () { + // browser.sleep(LONG_DELAY); + const world = this; + await browserWaits.retryWithActionCallback( async function (message) { + await headerPage.clickOrganisation(); + await browserWaits.waitForElement(viewOrganisationPage.header) + }); + expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; +}); + +Then(/^I should see name and address details of Organisation$/, async function () { + // browser.sleep(LONG_DELAY); + const world = this; + + await browserWaits.retryWithAction(viewOrganisationPage.header, async function (message) { + world.attach('Retrying Click Organisation : ' + message); + screenShotUtils.takeScreenshot() + .then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }); + await headerPage.clickOrganisation(); }); + expect(await viewOrganisationPage.amOnPage(), 'Organisation page not displayed').to.be.true; +}); diff --git a/test_codecept/e2e/features/step_definitions/viewUser.steps.js b/test_codecept/e2e/features/step_definitions/viewUser.steps.js index 319a41367..687264e1b 100644 --- a/test_codecept/e2e/features/step_definitions/viewUser.steps.js +++ b/test_codecept/e2e/features/step_definitions/viewUser.steps.js @@ -1,3 +1,4 @@ + const ViewUserPage = require('../pageObjects/viewUserPage.js'); const HeaderPage = require('../pageObjects/headerPage'); const loginPage = require('../pageObjects/loginLogoutObjects'); @@ -5,44 +6,43 @@ const loginPage = require('../pageObjects/loginLogoutObjects'); const { AMAZING_DELAY, SHORT_DELAY, MID_DELAY, LONG_DELAY } = require('../../support/constants'); const { config } = require('../../config/common.conf.js'); -const { defineSupportCode } = require('cucumber'); const browserWaits = require('../../support/customWaits'); - const viewUserPage = new ViewUserPage(); - const headerPage = new HeaderPage(); +const viewUserPage = new ViewUserPage(); +const headerPage = new HeaderPage(); - When(/^I click on user button$/, async function () { - // browser.sleep(LONG_DELAY); - const world = this; +When(/^I click on user button$/, async function () { + // browser.sleep(LONG_DELAY); + const world = this; - await headerPage.clickUser(); + await headerPage.clickUser(); - await browserWaits.retryWithActionCallback( async function (message) { - await browser.get(config.config.baseUrl+'/users'); - await browserWaits.waitForElement(viewUserPage.header) - // await headerPage.clickUser(); - }); + await browserWaits.retryWithActionCallback( async function (message) { + await browser.get(config.config.baseUrl+'/users'); + await browserWaits.waitForElement(viewUserPage.header) + // await headerPage.clickUser(); + }); - await viewUserPage.amOnPage(); + await viewUserPage.amOnPage(); - // browser.sleep(AMAZING_DELAY); - }); + // browser.sleep(AMAZING_DELAY); +}); - Then(/^I should be on display the user details$/, async function () { - // browser.sleep(AMAZING_DELAY); - expect(await viewUserPage.amOnPage()).to.be.true; - // browser.sleep(LONG_DELAY); - }); +Then(/^I should be on display the user details$/, async function () { + // browser.sleep(AMAZING_DELAY); + expect(await viewUserPage.amOnPage()).to.be.true; + // browser.sleep(LONG_DELAY); +}); - Then('I should see invited user is listed in users table', async function () { - await viewUserPage.validateUserWithEmailListed(global.latestInvitedUser); - }); +Then('I should see invited user is listed in users table', async function () { + await viewUserPage.validateUserWithEmailListed(global.latestInvitedUser); +}); - Then('I should see all user details displayed in table', async function () { - await viewUserPage.validateUsersTableDisplaysAllDetails(); - }); +Then('I should see all user details displayed in table', async function () { + await viewUserPage.validateUsersTableDisplaysAllDetails(); +}); - Then('I should see no empty cells in table', async function () { - await viewUserPage.validateTableHasNoEmptyCells(); - }); +Then('I should see no empty cells in table', async function () { + await viewUserPage.validateTableHasNoEmptyCells(); +}); diff --git a/test_codecept/e2e/support/hooks.js b/test_codecept/e2e/support/hooks.js index ab5692b83..04c4c41dd 100644 --- a/test_codecept/e2e/support/hooks.js +++ b/test_codecept/e2e/support/hooks.js @@ -1,6 +1,7 @@ 'use strict'; +const { Before, After} = require('cucumber'); + const Cucumber = require('cucumber'); -const { defineSupportCode } = require('cucumber'); const fs = require('fs'); const mkdirp = require('mkdirp'); const conf = require('../config/common.conf').config; @@ -16,7 +17,6 @@ const targetJson = `${jsonReports}/cucumber_report.json`; const { Given, When, Then } = require('cucumber'); const CucumberReportLogger = require('./reportLogger'); -// defineSupportCode(function({After }) { // registerHandler("BeforeFeature", { timeout: 500 * 1000 }, function() { // var origFn = browser.driver.controlFlow().execute; // @@ -91,38 +91,36 @@ const CucumberReportLogger = require('./reportLogger'); // }); -defineSupportCode(({ Before, After }) => { - Before(function (scenario, done){ - const world = this; - CucumberReportLogger.setScenarioWorld(world); - done(); - }); +Before(function (scenario, done){ + const world = this; + CucumberReportLogger.setScenarioWorld(world); + done(); +}); - After(function(scenario, done) { - const world = this; - if (scenario.result.status === 'failed') { - screenShotUtils.takeScreenshot().then((stream) => { - const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); - world.attach(decodedImage, 'image/png'); - }) - .then(() => { - browser.manage().logs().get('browser').then(function (browserLog) { - // console.log('log: ' + require('util').inspect(browserLog)); - const browserErrorLogs = []; - for (let browserLogCounter = 0; browserLogCounter < browserLog.length; browserLogCounter++){ - if (browserLog[browserLogCounter].level.value > 900){ - browserErrorLogs.push(browserLog[browserLogCounter]); - } +After(function(scenario, done) { + const world = this; + if (scenario.result.status === 'failed') { + screenShotUtils.takeScreenshot().then((stream) => { + const decodedImage = new Buffer(stream.replace(/^data:image\/(png|gif|jpeg);base64,/, ''), 'base64'); + world.attach(decodedImage, 'image/png'); + }) + .then(() => { + browser.manage().logs().get('browser').then(function (browserLog) { + // console.log('log: ' + require('util').inspect(browserLog)); + const browserErrorLogs = []; + for (let browserLogCounter = 0; browserLogCounter < browserLog.length; browserLogCounter++){ + if (browserLog[browserLogCounter].level.value > 900){ + browserErrorLogs.push(browserLog[browserLogCounter]); } - // world.attach(JSON.stringify(browserLog, null, 2)); + } + // world.attach(JSON.stringify(browserLog, null, 2)); - world.attach(JSON.stringify(browserErrorLogs, null, 2)); - // scenario.attach(scenario); - done(); - }); + world.attach(JSON.stringify(browserErrorLogs, null, 2)); + // scenario.attach(scenario); + done(); }); - } else { - done(); - } - }); + }); + } else { + done(); + } }); diff --git a/yarn-audit-known-issues b/yarn-audit-known-issues index 16e53db00..9f87c29da 100644 --- a/yarn-audit-known-issues +++ b/yarn-audit-known-issues @@ -1 +1 @@ -{"actions":[],"advisories":{"1085685":{"findings":[{"version":"1.1.0","paths":["@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>yargs>os-locale>mem"]}],"found_by":null,"deleted":null,"references":"- https://github.com/sindresorhus/mem/commit/da4e4398cb27b602de3bd55f746efa9b4a31702b\n- https://bugzilla.redhat.com/show_bug.cgi?id=1623744\n- https://www.npmjs.com/advisories/1084\n- https://snyk.io/vuln/npm:mem:20180117\n- https://github.com/advisories/GHSA-4xcv-9jjx-gfj3","created":"2019-07-05T21:07:58.000Z","id":1085685,"npm_advisory_id":null,"overview":"Versions of `mem` prior to 4.0.0 are vulnerable to Denial of Service (DoS). The package fails to remove old values from the cache even after a value passes its `maxAge` property. This may allow attackers to exhaust the system's memory if they are able to abuse the application logging.\n\n\n## Recommendation\n\nUpgrade to version 4.0.0 or later.","reported_by":null,"title":"Denial of Service in mem","metadata":null,"cves":[],"access":"public","severity":"moderate","module_name":"mem","vulnerable_versions":"<4.0.0","github_advisory_id":"GHSA-4xcv-9jjx-gfj3","recommendation":"Upgrade to version 4.0.0 or later","patched_versions":">=4.0.0","updated":"2023-01-09T05:01:45.000Z","cvss":{"score":5.1,"vectorString":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-4xcv-9jjx-gfj3"},"1088208":{"findings":[{"version":"0.8.4","paths":["git-rev-sync>shelljs"]}],"found_by":null,"deleted":null,"references":"- https://github.com/shelljs/shelljs/security/advisories/GHSA-64g7-mvw6-v9qj\n- https://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c/\n- https://github.com/advisories/GHSA-64g7-mvw6-v9qj","created":"2022-01-14T21:09:50.000Z","id":1088208,"npm_advisory_id":null,"overview":"### Impact\nOutput from the synchronous version of `shell.exec()` may be visible to other users on the same system. You may be affected if you execute `shell.exec()` in multi-user Mac, Linux, or WSL environments, or if you execute `shell.exec()` as the root user.\n\nOther shelljs functions (including the asynchronous version of `shell.exec()`) are not impacted.\n\n### Patches\nPatched in shelljs 0.8.5\n\n### Workarounds\nRecommended action is to upgrade to 0.8.5.\n\n### References\nhttps://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Ask at https://github.com/shelljs/shelljs/issues/1058\n* Open an issue at https://github.com/shelljs/shelljs/issues/new\n","reported_by":null,"title":"Improper Privilege Management in shelljs","metadata":null,"cves":[],"access":"public","severity":"moderate","module_name":"shelljs","vulnerable_versions":"<0.8.5","github_advisory_id":"GHSA-64g7-mvw6-v9qj","recommendation":"Upgrade to version 0.8.5 or later","patched_versions":">=0.8.5","updated":"2023-01-11T05:03:39.000Z","cvss":{"score":0,"vectorString":null},"cwe":["CWE-269"],"url":"https://github.com/advisories/GHSA-64g7-mvw6-v9qj"},"1088811":{"findings":[{"version":"8.1.0","paths":["@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>yargs>yargs-parser"]}],"found_by":null,"deleted":null,"references":"- https://snyk.io/vuln/SNYK-JS-YARGSPARSER-560381\n- https://www.npmjs.com/advisories/1500\n- https://github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2\n- https://nvd.nist.gov/vuln/detail/CVE-2020-7608\n- https://github.com/yargs/yargs-parser/commit/1c417bd0b42b09c475ee881e36d292af4fa2cc36\n- https://github.com/advisories/GHSA-p9pc-299p-vxgp","created":"2020-09-04T18:00:54.000Z","id":1088811,"npm_advisory_id":null,"overview":"Affected versions of `yargs-parser` are vulnerable to prototype pollution. Arguments are not properly sanitized, allowing an attacker to modify the prototype of `Object`, causing the addition or modification of an existing property that will exist on all objects. \nParsing the argument `--foo.__proto__.bar baz'` adds a `bar` property with value `baz` to all objects. This is only exploitable if attackers have control over the arguments being passed to `yargs-parser`.\n\n\n\n## Recommendation\n\nUpgrade to versions 13.1.2, 15.0.1, 18.1.1 or later.","reported_by":null,"title":"yargs-parser Vulnerable to Prototype Pollution","metadata":null,"cves":["CVE-2020-7608"],"access":"public","severity":"moderate","module_name":"yargs-parser","vulnerable_versions":">=6.0.0 <13.1.2","github_advisory_id":"GHSA-p9pc-299p-vxgp","recommendation":"Upgrade to version 13.1.2 or later","patched_versions":">=13.1.2","updated":"2023-01-27T05:00:51.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"},"cwe":["CWE-915","CWE-1321"],"url":"https://github.com/advisories/GHSA-p9pc-299p-vxgp"},"1088948":{"findings":[{"version":"9.6.0","paths":["@hmcts/rpx-xui-node-lib>openid-client>got"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-33987\n- https://github.com/sindresorhus/got/pull/2047\n- https://github.com/sindresorhus/got/compare/v12.0.3...v12.1.0\n- https://github.com/sindresorhus/got/commit/861ccd9ac2237df762a9e2beed7edd88c60782dc\n- https://github.com/sindresorhus/got/releases/tag/v11.8.5\n- https://github.com/sindresorhus/got/releases/tag/v12.1.0\n- https://github.com/advisories/GHSA-pfrx-2q88-qq97","created":"2022-06-19T00:00:21.000Z","id":1088948,"npm_advisory_id":null,"overview":"The got package before 11.8.5 and 12.1.0 for Node.js allows a redirect to a UNIX socket.","reported_by":null,"title":"Got allows a redirect to a UNIX socket","metadata":null,"cves":["CVE-2022-33987"],"access":"public","severity":"moderate","module_name":"got","vulnerable_versions":"<11.8.5","github_advisory_id":"GHSA-pfrx-2q88-qq97","recommendation":"Upgrade to version 11.8.5 or later","patched_versions":">=11.8.5","updated":"2023-01-27T05:05:01.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"},"cwe":[],"url":"https://github.com/advisories/GHSA-pfrx-2q88-qq97"},"1089270":{"findings":[{"version":"2.7.4","paths":["ejs"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-29078\n- https://eslam.io/posts/ejs-server-side-template-injection-rce/\n- https://github.com/mde/ejs/commit/15ee698583c98dadc456639d6245580d17a24baf\n- https://github.com/mde/ejs/releases\n- https://security.netapp.com/advisory/ntap-20220804-0001/\n- https://github.com/advisories/GHSA-phwq-j96m-2c2q","created":"2022-04-26T00:00:40.000Z","id":1089270,"npm_advisory_id":null,"overview":"The ejs (aka Embedded JavaScript templates) package 3.1.6 for Node.js allows server-side template injection in settings[view options][outputFunctionName]. This is parsed as an internal option, and overwrites the outputFunctionName option with an arbitrary OS command (which is executed upon template compilation).","reported_by":null,"title":"ejs template injection vulnerability","metadata":null,"cves":["CVE-2022-29078"],"access":"public","severity":"critical","module_name":"ejs","vulnerable_versions":"<3.1.7","github_advisory_id":"GHSA-phwq-j96m-2c2q","recommendation":"Upgrade to version 3.1.7 or later","patched_versions":">=3.1.7","updated":"2023-01-30T05:02:57.000Z","cvss":{"score":9.8,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},"cwe":["CWE-74"],"url":"https://github.com/advisories/GHSA-phwq-j96m-2c2q"},"1089698":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2021-32014\n- https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely/\n- https://sheetjs.com/pro\n- https://www.npmjs.com/package/xlsx/v/0.17.0\n- https://www.oracle.com/security-alerts/cpujan2022.html\n- https://github.com/advisories/GHSA-g973-978j-2c3p","created":"2021-07-22T19:47:15.000Z","id":1089698,"npm_advisory_id":null,"overview":"SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (CPU consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js.","reported_by":null,"title":"Denial of Service in SheetJS Pro","metadata":null,"cves":["CVE-2021-32014"],"access":"public","severity":"moderate","module_name":"xlsx","vulnerable_versions":"<0.17.0","github_advisory_id":"GHSA-g973-978j-2c3p","recommendation":"Upgrade to version 0.17.0 or later","patched_versions":">=0.17.0","updated":"2023-02-01T05:05:54.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},"cwe":["CWE-345","CWE-400"],"url":"https://github.com/advisories/GHSA-g973-978j-2c3p"},"1089699":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2021-32012\n- https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely/\n- https://sheetjs.com/pro\n- https://www.npmjs.com/package/xlsx/v/0.17.0\n- https://www.oracle.com/security-alerts/cpujan2022.html\n- https://github.com/advisories/GHSA-3x9f-74h4-2fqr","created":"2021-07-22T19:48:17.000Z","id":1089699,"npm_advisory_id":null,"overview":"SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (memory consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js (issue 1 of 2).","reported_by":null,"title":"Denial of Service in SheetJS Pro","metadata":null,"cves":["CVE-2021-32012"],"access":"public","severity":"moderate","module_name":"xlsx","vulnerable_versions":"<0.17.0","github_advisory_id":"GHSA-3x9f-74h4-2fqr","recommendation":"Upgrade to version 0.17.0 or later","patched_versions":">=0.17.0","updated":"2023-02-01T05:06:10.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-3x9f-74h4-2fqr"},"1089700":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2021-32013\n- https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely/\n- https://sheetjs.com/pro\n- https://www.npmjs.com/package/xlsx/v/0.17.0\n- https://www.oracle.com/security-alerts/cpujan2022.html\n- https://github.com/advisories/GHSA-8vcr-vxm8-293m","created":"2021-07-22T19:48:13.000Z","id":1089700,"npm_advisory_id":null,"overview":"SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (memory consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js (issue 2 of 2).","reported_by":null,"title":"Denial of Service in SheetsJS Pro","metadata":null,"cves":["CVE-2021-32013"],"access":"public","severity":"moderate","module_name":"xlsx","vulnerable_versions":"<0.17.0","github_advisory_id":"GHSA-8vcr-vxm8-293m","recommendation":"Upgrade to version 0.17.0 or later","patched_versions":">=0.17.0","updated":"2023-02-01T05:06:00.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-8vcr-vxm8-293m"},"1093639":{"findings":[{"version":"0.4.1","paths":["@hmcts/rpx-xui-node-lib>passport"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-25896\n- https://github.com/jaredhanson/passport/pull/900\n- https://github.com/jaredhanson/passport/commit/7e9b9cf4d7be02428e963fc729496a45baeea608\n- https://snyk.io/vuln/SNYK-JS-PASSPORT-2840631\n- https://github.com/advisories/GHSA-v923-w3x8-wh69","created":"2022-07-02T00:00:19.000Z","id":1093639,"npm_advisory_id":null,"overview":"This affects the package passport before 0.6.0. When a user logs in or logs out, the session is regenerated instead of being closed.","reported_by":null,"title":"Passport vulnerable to session regeneration when a users logs in or out","metadata":null,"cves":["CVE-2022-25896"],"access":"public","severity":"moderate","module_name":"passport","vulnerable_versions":"<0.6.0","github_advisory_id":"GHSA-v923-w3x8-wh69","recommendation":"Upgrade to version 0.6.0 or later","patched_versions":">=0.6.0","updated":"2023-09-11T16:22:18.000Z","cvss":{"score":4.8,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L"},"cwe":["CWE-384"],"url":"https://github.com/advisories/GHSA-v923-w3x8-wh69"},"1094599":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2023-30533\n- https://cdn.sheetjs.com/advisories/CVE-2023-30533\n- https://git.sheetjs.com/sheetjs/sheetjs/src/branch/master/CHANGELOG.md\n- https://git.sheetjs.com/sheetjs/sheetjs/issues/2667\n- https://git.sheetjs.com/sheetjs/sheetjs/issues/2986\n- https://github.com/advisories/GHSA-4r6h-8v6p-xvw6","created":"2023-04-24T09:30:19.000Z","id":1094599,"npm_advisory_id":null,"overview":"All versions of SheetJS CE through 0.19.2 are vulnerable to \"Prototype Pollution\" when reading specially crafted files. Workflows that do not read arbitrary files (for example, exporting data to spreadsheet files) are unaffected.\n\nA non-vulnerable version cannot be found via npm, as the repository hosted on GitHub and the npm package `xlsx` are no longer maintained.","reported_by":null,"title":"Prototype Pollution in sheetJS","metadata":null,"cves":["CVE-2023-30533"],"access":"public","severity":"high","module_name":"xlsx","vulnerable_versions":"<0.19.3","github_advisory_id":"GHSA-4r6h-8v6p-xvw6","recommendation":"Upgrade to version 0.19.3 or later","patched_versions":">=0.19.3","updated":"2023-11-06T05:04:13.000Z","cvss":{"score":7.8,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"},"cwe":["CWE-1321"],"url":"https://github.com/advisories/GHSA-4r6h-8v6p-xvw6"},"1095051":{"findings":[{"version":"0.7.0","paths":["ngx-md>marked"]}],"found_by":null,"deleted":null,"references":"- https://github.com/markedjs/marked/security/advisories/GHSA-rrrm-qjm4-v8hf\n- https://nvd.nist.gov/vuln/detail/CVE-2022-21680\n- https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0\n- https://github.com/markedjs/marked/releases/tag/v4.0.10\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/\n- https://github.com/advisories/GHSA-rrrm-qjm4-v8hf","created":"2022-01-14T21:04:41.000Z","id":1095051,"npm_advisory_id":null,"overview":"### Impact\n\n_What kind of vulnerability is it?_\n\nDenial of service.\n\nThe regular expression `block.def` may cause catastrophic backtracking against some strings.\nPoC is the following.\n\n```javascript\nimport * as marked from \"marked\";\n\nmarked.parse(`[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} x`);\n```\n\n_Who is impacted?_\n\nAnyone who runs untrusted markdown through marked and does not use a worker with a time limit.\n\n### Patches\n\n_Has the problem been patched?_\n\nYes\n\n_What versions should users upgrade to?_\n\n4.0.10\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nDo not run untrusted markdown through marked or run marked on a [worker](https://marked.js.org/using_advanced#workers) thread and set a reasonable time limit to prevent draining resources.\n\n### References\n\n_Are there any links users can visit to find out more?_\n\n- https://marked.js.org/using_advanced#workers\n- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [marked](https://github.com/markedjs/marked)\n","reported_by":null,"title":"Inefficient Regular Expression Complexity in marked","metadata":null,"cves":["CVE-2022-21680"],"access":"public","severity":"high","module_name":"marked","vulnerable_versions":"<4.0.10","github_advisory_id":"GHSA-rrrm-qjm4-v8hf","recommendation":"Upgrade to version 4.0.10 or later","patched_versions":">=4.0.10","updated":"2023-11-29T20:51:52.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-400","CWE-1333"],"url":"https://github.com/advisories/GHSA-rrrm-qjm4-v8hf"},"1095052":{"findings":[{"version":"0.7.0","paths":["ngx-md>marked"]}],"found_by":null,"deleted":null,"references":"- https://github.com/markedjs/marked/security/advisories/GHSA-5v2h-r2cx-5xgj\n- https://nvd.nist.gov/vuln/detail/CVE-2022-21681\n- https://github.com/markedjs/marked/commit/8f806573a3f6c6b7a39b8cdb66ab5ebb8d55a5f5\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/\n- https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0\n- https://github.com/advisories/GHSA-5v2h-r2cx-5xgj","created":"2022-01-14T21:04:46.000Z","id":1095052,"npm_advisory_id":null,"overview":"### Impact\n\n_What kind of vulnerability is it?_\n\nDenial of service.\n\nThe regular expression `inline.reflinkSearch` may cause catastrophic backtracking against some strings.\nPoC is the following.\n\n```javascript\nimport * as marked from 'marked';\n\nconsole.log(marked.parse(`[x]: x\n\n\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](`));\n```\n\n_Who is impacted?_\n\nAnyone who runs untrusted markdown through marked and does not use a worker with a time limit.\n\n### Patches\n\n_Has the problem been patched?_\n\nYes\n\n_What versions should users upgrade to?_\n\n4.0.10\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nDo not run untrusted markdown through marked or run marked on a [worker](https://marked.js.org/using_advanced#workers) thread and set a reasonable time limit to prevent draining resources.\n\n### References\n\n_Are there any links users can visit to find out more?_\n\n- https://marked.js.org/using_advanced#workers\n- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [marked](https://github.com/markedjs/marked)\n","reported_by":null,"title":"Inefficient Regular Expression Complexity in marked","metadata":null,"cves":["CVE-2022-21681"],"access":"public","severity":"high","module_name":"marked","vulnerable_versions":"<4.0.10","github_advisory_id":"GHSA-5v2h-r2cx-5xgj","recommendation":"Upgrade to version 4.0.10 or later","patched_versions":">=4.0.10","updated":"2023-11-29T20:51:17.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-5v2h-r2cx-5xgj"},"1095126":{"findings":[{"version":"0.8.4","paths":["git-rev-sync>shelljs"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-0144\n- https://github.com/shelljs/shelljs/commit/d919d22dd6de385edaa9d90313075a77f74b338c\n- https://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c\n- https://github.com/advisories/GHSA-4rq4-32rv-6wp6","created":"2022-01-21T23:37:28.000Z","id":1095126,"npm_advisory_id":null,"overview":"shelljs is vulnerable to Improper Privilege Management","reported_by":null,"title":"Improper Privilege Management in shelljs","metadata":null,"cves":["CVE-2022-0144"],"access":"public","severity":"high","module_name":"shelljs","vulnerable_versions":"<0.8.5","github_advisory_id":"GHSA-4rq4-32rv-6wp6","recommendation":"Upgrade to version 0.8.5 or later","patched_versions":">=0.8.5","updated":"2023-11-29T22:21:11.000Z","cvss":{"score":7.1,"vectorString":"CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H"},"cwe":["CWE-269"],"url":"https://github.com/advisories/GHSA-4rq4-32rv-6wp6"},"1095531":{"findings":[{"version":"6.2.1","paths":["log4js"]}],"found_by":null,"deleted":null,"references":"- https://github.com/log4js-node/log4js-node/security/advisories/GHSA-82v2-mx6x-wq7q\n- https://github.com/log4js-node/log4js-node/pull/1141/commits/8042252861a1b65adb66931fdf702ead34fa9b76\n- https://github.com/log4js-node/streamroller/pull/87\n- https://github.com/log4js-node/log4js-node/blob/v6.4.0/CHANGELOG.md#640\n- https://nvd.nist.gov/vuln/detail/CVE-2022-21704\n- https://lists.debian.org/debian-lts-announce/2022/12/msg00014.html\n- https://github.com/advisories/GHSA-82v2-mx6x-wq7q","created":"2022-01-21T18:53:27.000Z","id":1095531,"npm_advisory_id":null,"overview":"### Impact\r\nDefault file permissions for log files created by the file, fileSync and dateFile appenders are world-readable (in unix). This could cause problems if log files contain sensitive information. This would affect any users that have not supplied their own permissions for the files via the mode parameter in the config.\r\n\r\n### Patches\r\nFixed by:\r\n* https://github.com/log4js-node/log4js-node/pull/1141\r\n* https://github.com/log4js-node/streamroller/pull/87\r\n\r\nReleased to NPM in log4js@6.4.0\r\n\r\n### Workarounds\r\nEvery version of log4js published allows passing the mode parameter to the configuration of file appenders, see the documentation for details.\r\n\r\n### References\r\n\r\nThanks to [ranjit-git](https://www.huntr.dev/users/ranjit-git) for raising the issue, and to @lamweili for fixing the problem.\r\n\r\n### For more information\r\nIf you have any questions or comments about this advisory:\r\n* Open an issue in [logj4s-node](https://github.com/log4js-node/log4js-node)\r\n* Ask a question in the [slack channel](https://join.slack.com/t/log4js-node/shared_invite/enQtODkzMDQ3MzExMDczLWUzZmY0MmI0YWI1ZjFhODY0YjI0YmU1N2U5ZTRkOTYyYzg3MjY5NWI4M2FjZThjYjdiOGM0NjU2NzBmYTJjOGI)\r\n* Email us at [gareth.nomiddlename@gmail.com](mailto:gareth.nomiddlename@gmail.com)\r\n","reported_by":null,"title":"Incorrect Default Permissions in log4js","metadata":null,"cves":["CVE-2022-21704"],"access":"public","severity":"moderate","module_name":"log4js","vulnerable_versions":"<6.4.0","github_advisory_id":"GHSA-82v2-mx6x-wq7q","recommendation":"Upgrade to version 6.4.0 or later","patched_versions":">=6.4.0","updated":"2024-01-24T08:54:14.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"},"cwe":["CWE-276"],"url":"https://github.com/advisories/GHSA-82v2-mx6x-wq7q"},"1096832":{"findings":[{"version":"1.28.2","paths":["@hmcts/rpx-xui-node-lib>openid-client>jose"]}],"found_by":null,"deleted":null,"references":"- https://github.com/panva/jose/security/advisories/GHSA-hhhv-q57g-882q\n- https://github.com/panva/jose/commit/02a65794f7873cdaf12e81e80ad076fcdc4a9314\n- https://github.com/panva/jose/commit/1b91d88d2f8233f3477a5f4579aa5f8057b2ee8b\n- https://nvd.nist.gov/vuln/detail/CVE-2024-28176\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XJDO5VSIAOGT2WP63AXAAWNRSVJCNCRH\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KXKGNCRU7OTM5AHC7YIYBNOWI742PRMY\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/I6MMWFBOXJA6ZCXNVPDFJ4XMK5PVG5RG\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UJO2U5ACZVACNQXJ5EBRFLFW6DP5BROY\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UG5FSEYJ3GP27FZXC5YAAMMEC5XWKJHG\n- https://github.com/advisories/GHSA-hhhv-q57g-882q","created":"2024-03-07T17:40:57.000Z","id":1096832,"npm_advisory_id":null,"overview":"A vulnerability has been identified in the JSON Web Encryption (JWE) decryption interfaces, specifically related to the [support for decompressing plaintext after its decryption](https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.3). This allows an adversary to exploit specific scenarios where the compression ratio becomes exceptionally high. As a result, the length of the JWE token, which is determined by the compressed content's size, can land below application-defined limits. In such cases, other existing application level mechanisms for preventing resource exhaustion may be rendered ineffective.\n\nNote that as per [RFC 8725](https://www.rfc-editor.org/rfc/rfc8725.html#name-avoid-compression-of-encryp) compression of data SHOULD NOT be done before encryption, because such compressed data often reveals information about the plaintext. For this reason the v5.x major version of `jose` removed support for compressed payloads entirely and is therefore NOT affected by this advisory.\n\n### Impact\n\nUnder certain conditions it is possible to have the user's environment consume unreasonable amount of CPU time or memory during JWE Decryption operations.\n\n### Affected users\n\nThe impact is limited only to Node.js users utilizing the JWE decryption APIs to decrypt JWEs from untrusted sources.\n\nYou are NOT affected if any of the following applies to you\n\n- Your code uses jose version v5.x where JWE Compression is not supported anymore\n- Your code runs in an environment other than Node.js (e.g. Deno, CF Workers), which is the only runtime where JWE Compression is implemented out of the box\n- Your code does not use the JWE decryption APIs\n- Your code only accepts JWEs produced by trusted sources\n\n### Patches\n\n`v2.0.7` and `v4.15.5` releases limit the decompression routine to only allow decompressing up to 250 kB of plaintext. In v4.x it is possible to further adjust this limit via the `inflateRaw` decryption option implementation. In v2.x it is possible to further adjust this limit via the `inflateRawSyncLimit` decryption option.\n\n### Workarounds\n\nIf you cannot upgrade and do not want to support compressed JWEs you may detect and reject these tokens early by checking the token's protected header\n\n```js\nconst { zip } = jose.decodeProtectedHeader(token)\nif (zip !== undefined) {\n throw new Error('JWE Compression is not supported')\n}\n```\n\nIf you wish to continue supporting JWEs with compressed payloads in these legacy release lines you must upgrade (v1.x and v2.x to version v2.0.7, v3.x and v4.x to version v4.15.5) and review the limits put forth by the patched releases.\n\n### For more information\nIf you have any questions or comments about this advisory please open a discussion in the project's [repository](https://github.com/panva/jose/discussions/new?category=q-a&title=GHSA-hhhv-q57g-882q%20advisory%20question)","reported_by":null,"title":"jose vulnerable to resource exhaustion via specifically crafted JWE with compressed plaintext","metadata":null,"cves":["CVE-2024-28176"],"access":"public","severity":"moderate","module_name":"jose","vulnerable_versions":"<2.0.7","github_advisory_id":"GHSA-hhhv-q57g-882q","recommendation":"Upgrade to version 2.0.7 or later","patched_versions":">=2.0.7","updated":"2024-03-30T06:30:42.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-hhhv-q57g-882q"},"1096911":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-22363\n- https://cdn.sheetjs.com/advisories/CVE-2024-22363\n- https://cwe.mitre.org/data/definitions/1333.html\n- https://git.sheetjs.com/sheetjs/sheetjs/src/tag/v0.20.2\n- https://github.com/advisories/GHSA-5pgg-2g8v-p4x9","created":"2024-04-05T06:30:46.000Z","id":1096911,"npm_advisory_id":null,"overview":"SheetJS Community Edition before 0.20.2 is vulnerable.to Regular Expression Denial of Service (ReDoS).","reported_by":null,"title":"SheetJS Regular Expression Denial of Service (ReDoS)","metadata":null,"cves":["CVE-2024-22363"],"access":"public","severity":"high","module_name":"xlsx","vulnerable_versions":"<0.20.2","github_advisory_id":"GHSA-5pgg-2g8v-p4x9","recommendation":"Upgrade to version 0.20.2 or later","patched_versions":">=0.20.2","updated":"2024-04-08T13:47:06.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-5pgg-2g8v-p4x9"},"1097504":{"findings":[{"version":"2.5.207","paths":["pdfjs-dist","@hmcts/media-viewer>pdfjs-dist"]}],"found_by":null,"deleted":null,"references":"- https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq\n- https://github.com/mozilla/pdf.js/pull/18015\n- https://github.com/mozilla/pdf.js/commit/85e64b5c16c9aaef738f421733c12911a441cec6\n- https://bugzilla.mozilla.org/show_bug.cgi?id=1893645\n- https://nvd.nist.gov/vuln/detail/CVE-2024-4367\n- https://lists.debian.org/debian-lts-announce/2024/05/msg00010.html\n- https://lists.debian.org/debian-lts-announce/2024/05/msg00012.html\n- https://www.mozilla.org/security/advisories/mfsa2024-21\n- https://www.mozilla.org/security/advisories/mfsa2024-22\n- https://www.mozilla.org/security/advisories/mfsa2024-23\n- https://github.com/advisories/GHSA-wgrm-67xf-hhpq","created":"2024-05-07T10:25:08.000Z","id":1097504,"npm_advisory_id":null,"overview":"### Impact\nIf pdf.js is used to load a malicious PDF, and PDF.js is configured with `isEvalSupported` set to `true` (which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.\n\n### Patches\nThe patch removes the use of `eval`:\nhttps://github.com/mozilla/pdf.js/pull/18015\n\n### Workarounds\nSet the option `isEvalSupported` to `false`. \n\n### References\nhttps://bugzilla.mozilla.org/show_bug.cgi?id=1893645","reported_by":null,"title":"PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF","metadata":null,"cves":["CVE-2024-4367"],"access":"public","severity":"high","module_name":"pdfjs-dist","vulnerable_versions":"<=4.1.392","github_advisory_id":"GHSA-wgrm-67xf-hhpq","recommendation":"Upgrade to version 4.2.67 or later","patched_versions":">=4.2.67","updated":"2024-06-10T20:18:19.000Z","cvss":{"score":0,"vectorString":null},"cwe":[],"url":"https://github.com/advisories/GHSA-wgrm-67xf-hhpq"},"1097679":{"findings":[{"version":"0.26.1","paths":["axios","@hmcts/rpx-xui-node-lib>axios"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2023-45857\n- https://github.com/axios/axios/issues/6006\n- https://github.com/axios/axios/issues/6022\n- https://github.com/axios/axios/pull/6028\n- https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0\n- https://github.com/axios/axios/releases/tag/v1.6.0\n- https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459\n- https://github.com/axios/axios/pull/6091\n- https://github.com/axios/axios/commit/2755df562b9c194fba6d8b609a383443f6a6e967\n- https://github.com/axios/axios/releases/tag/v0.28.0\n- https://security.netapp.com/advisory/ntap-20240621-0006\n- https://github.com/advisories/GHSA-wf5p-g6vw-rhxx","created":"2023-11-08T21:30:37.000Z","id":1097679,"npm_advisory_id":null,"overview":"An issue discovered in Axios 0.8.1 through 1.5.1 inadvertently reveals the confidential XSRF-TOKEN stored in cookies by including it in the HTTP header X-XSRF-TOKEN for every request made to any host allowing attackers to view sensitive information.","reported_by":null,"title":"Axios Cross-Site Request Forgery Vulnerability","metadata":null,"cves":["CVE-2023-45857"],"access":"public","severity":"moderate","module_name":"axios","vulnerable_versions":">=0.8.1 <0.28.0","github_advisory_id":"GHSA-wf5p-g6vw-rhxx","recommendation":"Upgrade to version 0.28.0 or later","patched_versions":">=0.28.0","updated":"2024-06-21T21:33:58.000Z","cvss":{"score":6.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"},"cwe":["CWE-352"],"url":"https://github.com/advisories/GHSA-wf5p-g6vw-rhxx"},"1097682":{"findings":[{"version":"2.5.0","paths":["rx-polling-hmcts>jest-environment-jsdom>jsdom>tough-cookie"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2023-26136\n- https://github.com/salesforce/tough-cookie/issues/282\n- https://github.com/salesforce/tough-cookie/commit/12d474791bb856004e858fdb1c47b7608d09cf6e\n- https://github.com/salesforce/tough-cookie/releases/tag/v4.1.3\n- https://security.snyk.io/vuln/SNYK-JS-TOUGHCOOKIE-5672873\n- https://lists.debian.org/debian-lts-announce/2023/07/msg00010.html\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3HUE6ZR5SL73KHL7XUPAOEL6SB7HUDT2\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6PVVPNSAGSDS63HQ74PJ7MZ3MU5IYNVZ\n- https://security.netapp.com/advisory/ntap-20240621-0006\n- https://github.com/advisories/GHSA-72xf-g2v4-qvf3","created":"2023-07-01T06:30:16.000Z","id":1097682,"npm_advisory_id":null,"overview":"Versions of the package tough-cookie before 4.1.3 are vulnerable to Prototype Pollution due to improper handling of Cookies when using CookieJar in `rejectPublicSuffixes=false` mode. This issue arises from the manner in which the objects are initialized.","reported_by":null,"title":"tough-cookie Prototype Pollution vulnerability","metadata":null,"cves":["CVE-2023-26136"],"access":"public","severity":"moderate","module_name":"tough-cookie","vulnerable_versions":"<4.1.3","github_advisory_id":"GHSA-72xf-g2v4-qvf3","recommendation":"Upgrade to version 4.1.3 or later","patched_versions":">=4.1.3","updated":"2024-06-21T21:33:53.000Z","cvss":{"score":6.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"},"cwe":["CWE-1321"],"url":"https://github.com/advisories/GHSA-72xf-g2v4-qvf3"},"1097684":{"findings":[{"version":"8.5.1","paths":["jsonwebtoken"]}],"found_by":null,"deleted":null,"references":"- https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-qwph-4952-7xr6\n- https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3\n- https://nvd.nist.gov/vuln/detail/CVE-2022-23540\n- https://security.netapp.com/advisory/ntap-20240621-0007\n- https://github.com/advisories/GHSA-qwph-4952-7xr6","created":"2022-12-22T03:32:59.000Z","id":1097684,"npm_advisory_id":null,"overview":"# Overview\n\nIn versions <=8.5.1 of jsonwebtoken library, lack of algorithm definition and a falsy secret or key in the `jwt.verify()` function can lead to signature validation bypass due to defaulting to the `none` algorithm for signature verification.\n\n# Am I affected?\nYou will be affected if all the following are true in the `jwt.verify()` function:\n- a token with no signature is received\n- no algorithms are specified \n- a falsy (e.g. null, false, undefined) secret or key is passed \n\n# How do I fix it?\n \nUpdate to version 9.0.0 which removes the default support for the none algorithm in the `jwt.verify()` method. \n\n# Will the fix impact my users?\n\nThere will be no impact, if you update to version 9.0.0 and you don’t need to allow for the `none` algorithm. If you need 'none' algorithm, you have to explicitly specify that in `jwt.verify()` options.\n","reported_by":null,"title":"jsonwebtoken vulnerable to signature validation bypass due to insecure default algorithm in jwt.verify()","metadata":null,"cves":["CVE-2022-23540"],"access":"public","severity":"moderate","module_name":"jsonwebtoken","vulnerable_versions":"<9.0.0","github_advisory_id":"GHSA-qwph-4952-7xr6","recommendation":"Upgrade to version 9.0.0 or later","patched_versions":">=9.0.0","updated":"2024-06-21T21:34:57.000Z","cvss":{"score":6.4,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L"},"cwe":["CWE-287","CWE-327","CWE-347"],"url":"https://github.com/advisories/GHSA-qwph-4952-7xr6"},"1097690":{"findings":[{"version":"8.5.1","paths":["jsonwebtoken"]}],"found_by":null,"deleted":null,"references":"- https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-8cf7-32gw-wr33\n- https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3\n- https://nvd.nist.gov/vuln/detail/CVE-2022-23539\n- https://security.netapp.com/advisory/ntap-20240621-0007\n- https://github.com/advisories/GHSA-8cf7-32gw-wr33","created":"2022-12-22T03:32:22.000Z","id":1097690,"npm_advisory_id":null,"overview":"# Overview\n\nVersions `<=8.5.1` of `jsonwebtoken` library could be misconfigured so that legacy, insecure key types are used for signature verification. For example, DSA keys could be used with the RS256 algorithm. \n\n# Am I affected?\n\nYou are affected if you are using an algorithm and a key type other than the combinations mentioned below\n\n| Key type | algorithm |\n|----------|------------------------------------------|\n| ec | ES256, ES384, ES512 |\n| rsa | RS256, RS384, RS512, PS256, PS384, PS512 |\n| rsa-pss | PS256, PS384, PS512 |\n\nAnd for Elliptic Curve algorithms:\n\n| `alg` | Curve |\n|-------|------------|\n| ES256 | prime256v1 |\n| ES384 | secp384r1 |\n| ES512 | secp521r1 |\n\n# How do I fix it?\n\nUpdate to version 9.0.0. This version validates for asymmetric key type and algorithm combinations. Please refer to the above mentioned algorithm / key type combinations for the valid secure configuration. After updating to version 9.0.0, If you still intend to continue with signing or verifying tokens using invalid key type/algorithm value combinations, you’ll need to set the `allowInvalidAsymmetricKeyTypes` option to `true` in the `sign()` and/or `verify()` functions.\n\n# Will the fix impact my users?\n\nThere will be no impact, if you update to version 9.0.0 and you already use a valid secure combination of key type and algorithm. Otherwise, use the `allowInvalidAsymmetricKeyTypes` option to `true` in the `sign()` and `verify()` functions to continue usage of invalid key type/algorithm combination in 9.0.0 for legacy compatibility. \n\n","reported_by":null,"title":"jsonwebtoken unrestricted key type could lead to legacy keys usage ","metadata":null,"cves":["CVE-2022-23539"],"access":"public","severity":"high","module_name":"jsonwebtoken","vulnerable_versions":"<=8.5.1","github_advisory_id":"GHSA-8cf7-32gw-wr33","recommendation":"Upgrade to version 9.0.0 or later","patched_versions":">=9.0.0","updated":"2024-06-24T21:23:39.000Z","cvss":{"score":8.1,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"},"cwe":["CWE-327"],"url":"https://github.com/advisories/GHSA-8cf7-32gw-wr33"},"1097694":{"findings":[{"version":"8.5.1","paths":["jsonwebtoken"]}],"found_by":null,"deleted":null,"references":"- https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-hjrf-2m68-5959\n- https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3\n- https://nvd.nist.gov/vuln/detail/CVE-2022-23541\n- https://github.com/auth0/node-jsonwebtoken/releases/tag/v9.0.0\n- https://security.netapp.com/advisory/ntap-20240621-0007\n- https://github.com/advisories/GHSA-hjrf-2m68-5959","created":"2022-12-22T03:33:19.000Z","id":1097694,"npm_advisory_id":null,"overview":"# Overview\n\nVersions `<=8.5.1` of `jsonwebtoken` library can be misconfigured so that passing a poorly implemented key retrieval function (referring to the `secretOrPublicKey` argument from the [readme link](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback)) will result in incorrect verification of tokens. There is a possibility of using a different algorithm and key combination in verification than the one that was used to sign the tokens. Specifically, tokens signed with an asymmetric public key could be verified with a symmetric HS256 algorithm. This can lead to successful validation of forged tokens. \n\n# Am I affected?\n\nYou will be affected if your application is supporting usage of both symmetric key and asymmetric key in jwt.verify() implementation with the same key retrieval function. \n\n# How do I fix it?\n \nUpdate to version 9.0.0.\n\n# Will the fix impact my users?\n\nThere is no impact for end users","reported_by":null,"title":"jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC","metadata":null,"cves":["CVE-2022-23541"],"access":"public","severity":"moderate","module_name":"jsonwebtoken","vulnerable_versions":"<=8.5.1","github_advisory_id":"GHSA-hjrf-2m68-5959","recommendation":"Upgrade to version 9.0.0 or later","patched_versions":">=9.0.0","updated":"2024-06-24T21:24:07.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"},"cwe":["CWE-287","CWE-1259"],"url":"https://github.com/advisories/GHSA-hjrf-2m68-5959"},"1098366":{"findings":[{"version":"2.7.4","paths":["ejs"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-33883\n- https://github.com/mde/ejs/commit/e469741dca7df2eb400199e1cdb74621e3f89aa5\n- https://github.com/mde/ejs/compare/v3.1.9...v3.1.10\n- https://security.netapp.com/advisory/ntap-20240605-0003\n- https://github.com/advisories/GHSA-ghr5-ch3p-vcr6","created":"2024-04-28T18:30:31.000Z","id":1098366,"npm_advisory_id":null,"overview":"The ejs (aka Embedded JavaScript templates) package before 3.1.10 for Node.js lacks certain pollution protection.","reported_by":null,"title":"ejs lacks certain pollution protection","metadata":null,"cves":["CVE-2024-33883"],"access":"public","severity":"moderate","module_name":"ejs","vulnerable_versions":"<3.1.10","github_advisory_id":"GHSA-ghr5-ch3p-vcr6","recommendation":"Upgrade to version 3.1.10 or later","patched_versions":">=3.1.10","updated":"2024-08-02T15:45:54.000Z","cvss":{"score":4,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"cwe":["CWE-693","CWE-1321"],"url":"https://github.com/advisories/GHSA-ghr5-ch3p-vcr6"},"1098393":{"findings":[{"version":"7.4.6","paths":["puppeteer>ws","@hmcts/media-viewer>socket.io-client>engine.io-client>ws"]}],"found_by":null,"deleted":null,"references":"- https://github.com/websockets/ws/security/advisories/GHSA-3h5v-q93c-6h6q\n- https://github.com/websockets/ws/issues/2230\n- https://github.com/websockets/ws/pull/2231\n- https://github.com/websockets/ws/commit/22c28763234aa75a7e1b76f5c01c181260d7917f\n- https://github.com/websockets/ws/commit/4abd8f6de4b0b65ef80b3ff081989479ed93377e\n- https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c\n- https://github.com/websockets/ws/commit/eeb76d313e2a00dd5247ca3597bba7877d064a63\n- https://github.com/advisories/GHSA-3h5v-q93c-6h6q","created":"2024-06-17T19:09:10.000Z","id":1098393,"npm_advisory_id":null,"overview":"### Impact\n\nA request with a number of headers exceeding the[`server.maxHeadersCount`][] threshold could be used to crash a ws server.\n\n### Proof of concept\n\n```js\nconst http = require('http');\nconst WebSocket = require('ws');\n\nconst wss = new WebSocket.Server({ port: 0 }, function () {\n const chars = \"!#$%&'*+-.0123456789abcdefghijklmnopqrstuvwxyz^_`|~\".split('');\n const headers = {};\n let count = 0;\n\n for (let i = 0; i < chars.length; i++) {\n if (count === 2000) break;\n\n for (let j = 0; j < chars.length; j++) {\n const key = chars[i] + chars[j];\n headers[key] = 'x';\n\n if (++count === 2000) break;\n }\n }\n\n headers.Connection = 'Upgrade';\n headers.Upgrade = 'websocket';\n headers['Sec-WebSocket-Key'] = 'dGhlIHNhbXBsZSBub25jZQ==';\n headers['Sec-WebSocket-Version'] = '13';\n\n const request = http.request({\n headers: headers,\n host: '127.0.0.1',\n port: wss.address().port\n });\n\n request.end();\n});\n```\n\n### Patches\n\nThe vulnerability was fixed in ws@8.17.1 (https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c) and backported to ws@7.5.10 (https://github.com/websockets/ws/commit/22c28763234aa75a7e1b76f5c01c181260d7917f), ws@6.2.3 (https://github.com/websockets/ws/commit/eeb76d313e2a00dd5247ca3597bba7877d064a63), and ws@5.2.4 (https://github.com/websockets/ws/commit/4abd8f6de4b0b65ef80b3ff081989479ed93377e)\n\n### Workarounds\n\nIn vulnerable versions of ws, the issue can be mitigated in the following ways:\n\n1. Reduce the maximum allowed length of the request headers using the [`--max-http-header-size=size`][] and/or the [`maxHeaderSize`][] options so that no more headers than the `server.maxHeadersCount` limit can be sent.\n2. Set `server.maxHeadersCount` to `0` so that no limit is applied.\n\n### Credits\n\nThe vulnerability was reported by [Ryan LaPointe](https://github.com/rrlapointe) in https://github.com/websockets/ws/issues/2230.\n\n### References\n\n- https://github.com/websockets/ws/issues/2230\n- https://github.com/websockets/ws/pull/2231\n\n[`--max-http-header-size=size`]: https://nodejs.org/api/cli.html#--max-http-header-sizesize\n[`maxHeaderSize`]: https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener\n[`server.maxHeadersCount`]: https://nodejs.org/api/http.html#servermaxheaderscount\n","reported_by":null,"title":"ws affected by a DoS when handling a request with many HTTP headers","metadata":null,"cves":["CVE-2024-37890"],"access":"public","severity":"high","module_name":"ws","vulnerable_versions":">=7.0.0 <7.5.10","github_advisory_id":"GHSA-3h5v-q93c-6h6q","recommendation":"Upgrade to version 7.5.10 or later","patched_versions":">=7.5.10","updated":"2024-08-05T05:02:34.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-476"],"url":"https://github.com/advisories/GHSA-3h5v-q93c-6h6q"},"1098681":{"findings":[{"version":"4.0.5","paths":["http-proxy-middleware>micromatch","@hmcts/rpx-xui-node-lib>ts-auto-mock>micromatch","@hmcts/rpx-xui-node-lib>jest-ts-auto-mock>ts-auto-mock>micromatch","rx-polling-hmcts>jest-environment-jsdom>@jest/fake-timers>jest-message-util>micromatch","rx-polling-hmcts>jest-environment-jsdom>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runtime>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runner>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runner>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>@jest/core>jest-runner>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>@jest/core>jest-config>jest-runner>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>@jest/core>jest-config>jest-runner>jest-runtime>@jest/globals>@jest/expect>jest-snapshot>expect>jest-message-util>micromatch"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-4067\n- https://github.com/micromatch/micromatch/issues/243\n- https://github.com/micromatch/micromatch/pull/247\n- https://devhub.checkmarx.com/cve-details/CVE-2024-4067\n- https://github.com/micromatch/micromatch/blob/2c56a8604b68c1099e7bc0f807ce0865a339747a/index.js#L448\n- https://github.com/micromatch/micromatch/commit/500d5d6f42f0e8dfa1cb5464c6cb420b1b6aaaa0\n- https://github.com/micromatch/micromatch/pull/266\n- https://github.com/micromatch/micromatch/commit/03aa8052171e878897eee5d7bb2ae0ae83ec2ade\n- https://advisory.checkmarx.net/advisory/CVE-2024-4067\n- https://github.com/micromatch/micromatch/releases/tag/4.0.8\n- https://github.com/advisories/GHSA-952p-6rrq-rcjv","created":"2024-05-14T18:30:54.000Z","id":1098681,"npm_advisory_id":null,"overview":"The NPM package `micromatch` prior to version 4.0.8 is vulnerable to Regular Expression Denial of Service (ReDoS). The vulnerability occurs in `micromatch.braces()` in `index.js` because the pattern `.*` will greedily match anything. By passing a malicious payload, the pattern matching will keep backtracking to the input while it doesn't find the closing bracket. As the input size increases, the consumption time will also increase until it causes the application to hang or slow down. There was a merged fix but further testing shows the issue persisted prior to https://github.com/micromatch/micromatch/pull/266. This issue should be mitigated by using a safe pattern that won't start backtracking the regular expression due to greedy matching.\n","reported_by":null,"title":"Regular Expression Denial of Service (ReDoS) in micromatch","metadata":null,"cves":["CVE-2024-4067"],"access":"public","severity":"moderate","module_name":"micromatch","vulnerable_versions":"<4.0.8","github_advisory_id":"GHSA-952p-6rrq-rcjv","recommendation":"Upgrade to version 4.0.8 or later","patched_versions":">=4.0.8","updated":"2024-08-28T13:12:27.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-952p-6rrq-rcjv"},"1099520":{"findings":[{"version":"1.20.2","paths":["body-parser","express>body-parser","@hmcts/rpx-xui-node-lib>express>body-parser"]}],"found_by":null,"deleted":null,"references":"- https://github.com/expressjs/body-parser/security/advisories/GHSA-qwcr-r2fm-qrc7\n- https://github.com/expressjs/body-parser/commit/b2695c4450f06ba3b0ccf48d872a229bb41c9bce\n- https://nvd.nist.gov/vuln/detail/CVE-2024-45590\n- https://github.com/advisories/GHSA-qwcr-r2fm-qrc7","created":"2024-09-10T15:52:39.000Z","id":1099520,"npm_advisory_id":null,"overview":"### Impact\n\nbody-parser <1.20.3 is vulnerable to denial of service when url encoding is enabled. A malicious actor using a specially crafted payload could flood the server with a large number of requests, resulting in denial of service.\n\n### Patches\n\nthis issue is patched in 1.20.3\n\n### References\n","reported_by":null,"title":"body-parser vulnerable to denial of service when url encoding is enabled","metadata":null,"cves":["CVE-2024-45590"],"access":"public","severity":"high","module_name":"body-parser","vulnerable_versions":"<1.20.3","github_advisory_id":"GHSA-qwcr-r2fm-qrc7","recommendation":"Upgrade to version 1.20.3 or later","patched_versions":">=1.20.3","updated":"2024-09-10T19:01:11.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-405"],"url":"https://github.com/advisories/GHSA-qwcr-r2fm-qrc7"},"1099525":{"findings":[{"version":"0.18.0","paths":["express>send","@hmcts/rpx-xui-node-lib>express>send","@hmcts/rpx-xui-node-lib>express>serve-static>send"]}],"found_by":null,"deleted":null,"references":"- https://github.com/pillarjs/send/security/advisories/GHSA-m6fv-jmcg-4jfg\n- https://nvd.nist.gov/vuln/detail/CVE-2024-43799\n- https://github.com/pillarjs/send/commit/ae4f2989491b392ae2ef3b0015a019770ae65d35\n- https://github.com/advisories/GHSA-m6fv-jmcg-4jfg","created":"2024-09-10T19:42:41.000Z","id":1099525,"npm_advisory_id":null,"overview":"### Impact\n\npassing untrusted user input - even after sanitizing it - to `SendStream.redirect()` may execute untrusted code\n\n### Patches\n\nthis issue is patched in send 0.19.0\n\n### Workarounds\n\nusers are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist\n\n### Details\n\nsuccessful exploitation of this vector requires the following:\n\n1. The attacker MUST control the input to response.redirect()\n1. express MUST NOT redirect before the template appears\n1. the browser MUST NOT complete redirection before:\n1. the user MUST click on the link in the template\n","reported_by":null,"title":"send vulnerable to template injection that can lead to XSS","metadata":null,"cves":["CVE-2024-43799"],"access":"public","severity":"moderate","module_name":"send","vulnerable_versions":"<0.19.0","github_advisory_id":"GHSA-m6fv-jmcg-4jfg","recommendation":"Upgrade to version 0.19.0 or later","patched_versions":">=0.19.0","updated":"2024-09-10T19:42:42.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L"},"cwe":["CWE-79"],"url":"https://github.com/advisories/GHSA-m6fv-jmcg-4jfg"},"1099527":{"findings":[{"version":"1.15.0","paths":["express>serve-static","@hmcts/rpx-xui-node-lib>express>serve-static"]}],"found_by":null,"deleted":null,"references":"- https://github.com/expressjs/serve-static/security/advisories/GHSA-cm22-4g7w-348p\n- https://nvd.nist.gov/vuln/detail/CVE-2024-43800\n- https://github.com/expressjs/serve-static/commit/0c11fad159898cdc69fd9ab63269b72468ecaf6b\n- https://github.com/expressjs/serve-static/commit/ce730896fddce1588111d9ef6fdf20896de5c6fa\n- https://github.com/advisories/GHSA-cm22-4g7w-348p","created":"2024-09-10T19:42:33.000Z","id":1099527,"npm_advisory_id":null,"overview":"### Impact\n\npassing untrusted user input - even after sanitizing it - to `redirect()` may execute untrusted code\n\n### Patches\n\nthis issue is patched in serve-static 1.16.0\n\n### Workarounds\n\nusers are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist\n\n### Details\n\nsuccessful exploitation of this vector requires the following:\n\n1. The attacker MUST control the input to response.redirect()\n1. express MUST NOT redirect before the template appears\n1. the browser MUST NOT complete redirection before:\n1. the user MUST click on the link in the template\n","reported_by":null,"title":"serve-static vulnerable to template injection that can lead to XSS","metadata":null,"cves":["CVE-2024-43800"],"access":"public","severity":"moderate","module_name":"serve-static","vulnerable_versions":"<1.16.0","github_advisory_id":"GHSA-cm22-4g7w-348p","recommendation":"Upgrade to version 1.16.0 or later","patched_versions":">=1.16.0","updated":"2024-09-10T19:42:34.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L"},"cwe":["CWE-79"],"url":"https://github.com/advisories/GHSA-cm22-4g7w-348p"},"1099529":{"findings":[{"version":"4.19.2","paths":["express","@hmcts/rpx-xui-node-lib>express"]}],"found_by":null,"deleted":null,"references":"- https://github.com/expressjs/express/security/advisories/GHSA-qw6h-vgh9-j6wx\n- https://nvd.nist.gov/vuln/detail/CVE-2024-43796\n- https://github.com/expressjs/express/commit/54271f69b511fea198471e6ff3400ab805d6b553\n- https://github.com/advisories/GHSA-qw6h-vgh9-j6wx","created":"2024-09-10T19:41:04.000Z","id":1099529,"npm_advisory_id":null,"overview":"### Impact\n\nIn express <4.20.0, passing untrusted user input - even after sanitizing it - to `response.redirect()` may execute untrusted code\n\n### Patches\n\nthis issue is patched in express 4.20.0\n\n### Workarounds\n\nusers are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist\n\n### Details\n\nsuccessful exploitation of this vector requires the following:\n\n1. The attacker MUST control the input to response.redirect()\n1. express MUST NOT redirect before the template appears\n1. the browser MUST NOT complete redirection before:\n1. the user MUST click on the link in the template\n","reported_by":null,"title":"express vulnerable to XSS via response.redirect()","metadata":null,"cves":["CVE-2024-43796"],"access":"public","severity":"moderate","module_name":"express","vulnerable_versions":"<4.20.0","github_advisory_id":"GHSA-qw6h-vgh9-j6wx","recommendation":"Upgrade to version 4.20.0 or later","patched_versions":">=4.20.0","updated":"2024-09-10T19:41:07.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L"},"cwe":["CWE-79"],"url":"https://github.com/advisories/GHSA-qw6h-vgh9-j6wx"},"1099562":{"findings":[{"version":"0.1.7","paths":["express>path-to-regexp","@hmcts/rpx-xui-node-lib>express>path-to-regexp"]}],"found_by":null,"deleted":null,"references":"- https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j\n- https://github.com/pillarjs/path-to-regexp/commit/29b96b4a1de52824e1ca0f49a701183cc4ed476f\n- https://github.com/pillarjs/path-to-regexp/commit/60f2121e9b66b7b622cc01080df0aabda9eedee6\n- https://nvd.nist.gov/vuln/detail/CVE-2024-45296\n- https://github.com/pillarjs/path-to-regexp/commit/925ac8e3c5780b02f58cbd4e52f95da8ad2ac485\n- https://github.com/pillarjs/path-to-regexp/commit/d31670ae8f6e69cbfd56e835742195b7d10942ef\n- https://github.com/pillarjs/path-to-regexp/commit/f1253b47b347dcb909e3e80b0eb2649109e59894\n- https://github.com/pillarjs/path-to-regexp/releases/tag/v6.3.0\n- https://github.com/advisories/GHSA-9wv6-86v2-598j","created":"2024-09-09T20:19:15.000Z","id":1099562,"npm_advisory_id":null,"overview":"### Impact\n\nA bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (`.`). For example, `/:a-:b`.\n\n### Patches\n\nFor users of 0.1, upgrade to `0.1.10`. All other users should upgrade to `8.0.0`.\n\nThese versions add backtrack protection when a custom regex pattern is not provided:\n\n- [0.1.10](https://github.com/pillarjs/path-to-regexp/releases/tag/v0.1.10)\n- [1.9.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v1.9.0)\n- [3.3.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v3.3.0)\n- [6.3.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v6.3.0)\n\nThey do not protect against vulnerable user supplied capture groups. Protecting against explicit user patterns is out of scope for old versions and not considered a vulnerability.\n\nVersion [7.1.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v7.1.0) can enable `strict: true` and get an error when the regular expression might be bad.\n\nVersion [8.0.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0) removes the features that can cause a ReDoS.\n\n### Workarounds\n\nAll versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change `/:a-:b` to `/:a-:b([^-/]+)`.\n\nIf paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.\n\n### Details\n\nUsing `/:a-:b` will produce the regular expression `/^\\/([^\\/]+?)-([^\\/]+?)\\/?$/`. This can be exploited by a path such as `/a${'-a'.repeat(8_000)}/a`. [OWASP](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) has a good example of why this occurs, but the TL;DR is the `/a` at the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the `:a-:b` on the repeated 8,000 `-a`.\n\nBecause JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.\n\n### References\n\n* [OWASP](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)\n* [Detailed blog post](https://blakeembrey.com/posts/2024-09-web-redos/)","reported_by":null,"title":"path-to-regexp outputs backtracking regular expressions","metadata":null,"cves":["CVE-2024-45296"],"access":"public","severity":"high","module_name":"path-to-regexp","vulnerable_versions":"<0.1.10","github_advisory_id":"GHSA-9wv6-86v2-598j","recommendation":"Upgrade to version 0.1.10 or later","patched_versions":">=0.1.10","updated":"2024-09-12T17:09:43.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-9wv6-86v2-598j"}},"muted":[],"metadata":{"vulnerabilities":{"info":0,"low":0,"moderate":36,"high":15,"critical":1},"dependencies":1001,"devDependencies":5,"optionalDependencies":0,"totalDependencies":1006}} +{"actions":[],"advisories":{"1085685":{"findings":[{"version":"1.1.0","paths":["@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>yargs>os-locale>mem"]}],"found_by":null,"deleted":null,"references":"- https://github.com/sindresorhus/mem/commit/da4e4398cb27b602de3bd55f746efa9b4a31702b\n- https://bugzilla.redhat.com/show_bug.cgi?id=1623744\n- https://www.npmjs.com/advisories/1084\n- https://snyk.io/vuln/npm:mem:20180117\n- https://github.com/advisories/GHSA-4xcv-9jjx-gfj3","created":"2019-07-05T21:07:58.000Z","id":1085685,"npm_advisory_id":null,"overview":"Versions of `mem` prior to 4.0.0 are vulnerable to Denial of Service (DoS). The package fails to remove old values from the cache even after a value passes its `maxAge` property. This may allow attackers to exhaust the system's memory if they are able to abuse the application logging.\n\n\n## Recommendation\n\nUpgrade to version 4.0.0 or later.","reported_by":null,"title":"Denial of Service in mem","metadata":null,"cves":[],"access":"public","severity":"moderate","module_name":"mem","vulnerable_versions":"<4.0.0","github_advisory_id":"GHSA-4xcv-9jjx-gfj3","recommendation":"Upgrade to version 4.0.0 or later","patched_versions":">=4.0.0","updated":"2023-01-09T05:01:45.000Z","cvss":{"score":5.1,"vectorString":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-4xcv-9jjx-gfj3"},"1088208":{"findings":[{"version":"0.8.4","paths":["git-rev-sync>shelljs"]}],"found_by":null,"deleted":null,"references":"- https://github.com/shelljs/shelljs/security/advisories/GHSA-64g7-mvw6-v9qj\n- https://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c/\n- https://github.com/advisories/GHSA-64g7-mvw6-v9qj","created":"2022-01-14T21:09:50.000Z","id":1088208,"npm_advisory_id":null,"overview":"### Impact\nOutput from the synchronous version of `shell.exec()` may be visible to other users on the same system. You may be affected if you execute `shell.exec()` in multi-user Mac, Linux, or WSL environments, or if you execute `shell.exec()` as the root user.\n\nOther shelljs functions (including the asynchronous version of `shell.exec()`) are not impacted.\n\n### Patches\nPatched in shelljs 0.8.5\n\n### Workarounds\nRecommended action is to upgrade to 0.8.5.\n\n### References\nhttps://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Ask at https://github.com/shelljs/shelljs/issues/1058\n* Open an issue at https://github.com/shelljs/shelljs/issues/new\n","reported_by":null,"title":"Improper Privilege Management in shelljs","metadata":null,"cves":[],"access":"public","severity":"moderate","module_name":"shelljs","vulnerable_versions":"<0.8.5","github_advisory_id":"GHSA-64g7-mvw6-v9qj","recommendation":"Upgrade to version 0.8.5 or later","patched_versions":">=0.8.5","updated":"2023-01-11T05:03:39.000Z","cvss":{"score":0,"vectorString":null},"cwe":["CWE-269"],"url":"https://github.com/advisories/GHSA-64g7-mvw6-v9qj"},"1088811":{"findings":[{"version":"8.1.0","paths":["@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>yargs>yargs-parser"]}],"found_by":null,"deleted":null,"references":"- https://snyk.io/vuln/SNYK-JS-YARGSPARSER-560381\n- https://www.npmjs.com/advisories/1500\n- https://github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2\n- https://nvd.nist.gov/vuln/detail/CVE-2020-7608\n- https://github.com/yargs/yargs-parser/commit/1c417bd0b42b09c475ee881e36d292af4fa2cc36\n- https://github.com/advisories/GHSA-p9pc-299p-vxgp","created":"2020-09-04T18:00:54.000Z","id":1088811,"npm_advisory_id":null,"overview":"Affected versions of `yargs-parser` are vulnerable to prototype pollution. Arguments are not properly sanitized, allowing an attacker to modify the prototype of `Object`, causing the addition or modification of an existing property that will exist on all objects. \nParsing the argument `--foo.__proto__.bar baz'` adds a `bar` property with value `baz` to all objects. This is only exploitable if attackers have control over the arguments being passed to `yargs-parser`.\n\n\n\n## Recommendation\n\nUpgrade to versions 13.1.2, 15.0.1, 18.1.1 or later.","reported_by":null,"title":"yargs-parser Vulnerable to Prototype Pollution","metadata":null,"cves":["CVE-2020-7608"],"access":"public","severity":"moderate","module_name":"yargs-parser","vulnerable_versions":">=6.0.0 <13.1.2","github_advisory_id":"GHSA-p9pc-299p-vxgp","recommendation":"Upgrade to version 13.1.2 or later","patched_versions":">=13.1.2","updated":"2023-01-27T05:00:51.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"},"cwe":["CWE-915","CWE-1321"],"url":"https://github.com/advisories/GHSA-p9pc-299p-vxgp"},"1088948":{"findings":[{"version":"9.6.0","paths":["@hmcts/rpx-xui-node-lib>openid-client>got"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-33987\n- https://github.com/sindresorhus/got/pull/2047\n- https://github.com/sindresorhus/got/compare/v12.0.3...v12.1.0\n- https://github.com/sindresorhus/got/commit/861ccd9ac2237df762a9e2beed7edd88c60782dc\n- https://github.com/sindresorhus/got/releases/tag/v11.8.5\n- https://github.com/sindresorhus/got/releases/tag/v12.1.0\n- https://github.com/advisories/GHSA-pfrx-2q88-qq97","created":"2022-06-19T00:00:21.000Z","id":1088948,"npm_advisory_id":null,"overview":"The got package before 11.8.5 and 12.1.0 for Node.js allows a redirect to a UNIX socket.","reported_by":null,"title":"Got allows a redirect to a UNIX socket","metadata":null,"cves":["CVE-2022-33987"],"access":"public","severity":"moderate","module_name":"got","vulnerable_versions":"<11.8.5","github_advisory_id":"GHSA-pfrx-2q88-qq97","recommendation":"Upgrade to version 11.8.5 or later","patched_versions":">=11.8.5","updated":"2023-01-27T05:05:01.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"},"cwe":[],"url":"https://github.com/advisories/GHSA-pfrx-2q88-qq97"},"1089270":{"findings":[{"version":"2.7.4","paths":["ejs"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-29078\n- https://eslam.io/posts/ejs-server-side-template-injection-rce/\n- https://github.com/mde/ejs/commit/15ee698583c98dadc456639d6245580d17a24baf\n- https://github.com/mde/ejs/releases\n- https://security.netapp.com/advisory/ntap-20220804-0001/\n- https://github.com/advisories/GHSA-phwq-j96m-2c2q","created":"2022-04-26T00:00:40.000Z","id":1089270,"npm_advisory_id":null,"overview":"The ejs (aka Embedded JavaScript templates) package 3.1.6 for Node.js allows server-side template injection in settings[view options][outputFunctionName]. This is parsed as an internal option, and overwrites the outputFunctionName option with an arbitrary OS command (which is executed upon template compilation).","reported_by":null,"title":"ejs template injection vulnerability","metadata":null,"cves":["CVE-2022-29078"],"access":"public","severity":"critical","module_name":"ejs","vulnerable_versions":"<3.1.7","github_advisory_id":"GHSA-phwq-j96m-2c2q","recommendation":"Upgrade to version 3.1.7 or later","patched_versions":">=3.1.7","updated":"2023-01-30T05:02:57.000Z","cvss":{"score":9.8,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},"cwe":["CWE-74"],"url":"https://github.com/advisories/GHSA-phwq-j96m-2c2q"},"1089698":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2021-32014\n- https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely/\n- https://sheetjs.com/pro\n- https://www.npmjs.com/package/xlsx/v/0.17.0\n- https://www.oracle.com/security-alerts/cpujan2022.html\n- https://github.com/advisories/GHSA-g973-978j-2c3p","created":"2021-07-22T19:47:15.000Z","id":1089698,"npm_advisory_id":null,"overview":"SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (CPU consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js.","reported_by":null,"title":"Denial of Service in SheetJS Pro","metadata":null,"cves":["CVE-2021-32014"],"access":"public","severity":"moderate","module_name":"xlsx","vulnerable_versions":"<0.17.0","github_advisory_id":"GHSA-g973-978j-2c3p","recommendation":"Upgrade to version 0.17.0 or later","patched_versions":">=0.17.0","updated":"2023-02-01T05:05:54.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},"cwe":["CWE-345","CWE-400"],"url":"https://github.com/advisories/GHSA-g973-978j-2c3p"},"1089699":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2021-32012\n- https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely/\n- https://sheetjs.com/pro\n- https://www.npmjs.com/package/xlsx/v/0.17.0\n- https://www.oracle.com/security-alerts/cpujan2022.html\n- https://github.com/advisories/GHSA-3x9f-74h4-2fqr","created":"2021-07-22T19:48:17.000Z","id":1089699,"npm_advisory_id":null,"overview":"SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (memory consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js (issue 1 of 2).","reported_by":null,"title":"Denial of Service in SheetJS Pro","metadata":null,"cves":["CVE-2021-32012"],"access":"public","severity":"moderate","module_name":"xlsx","vulnerable_versions":"<0.17.0","github_advisory_id":"GHSA-3x9f-74h4-2fqr","recommendation":"Upgrade to version 0.17.0 or later","patched_versions":">=0.17.0","updated":"2023-02-01T05:06:10.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-3x9f-74h4-2fqr"},"1089700":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2021-32013\n- https://floqast.com/engineering-blog/post/fuzzing-and-parsing-securely/\n- https://sheetjs.com/pro\n- https://www.npmjs.com/package/xlsx/v/0.17.0\n- https://www.oracle.com/security-alerts/cpujan2022.html\n- https://github.com/advisories/GHSA-8vcr-vxm8-293m","created":"2021-07-22T19:48:13.000Z","id":1089700,"npm_advisory_id":null,"overview":"SheetJS Pro through 0.16.9 allows attackers to cause a denial of service (memory consumption) via a crafted .xlsx document that is mishandled when read by xlsx.js (issue 2 of 2).","reported_by":null,"title":"Denial of Service in SheetsJS Pro","metadata":null,"cves":["CVE-2021-32013"],"access":"public","severity":"moderate","module_name":"xlsx","vulnerable_versions":"<0.17.0","github_advisory_id":"GHSA-8vcr-vxm8-293m","recommendation":"Upgrade to version 0.17.0 or later","patched_versions":">=0.17.0","updated":"2023-02-01T05:06:00.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-8vcr-vxm8-293m"},"1093639":{"findings":[{"version":"0.4.1","paths":["@hmcts/rpx-xui-node-lib>passport"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-25896\n- https://github.com/jaredhanson/passport/pull/900\n- https://github.com/jaredhanson/passport/commit/7e9b9cf4d7be02428e963fc729496a45baeea608\n- https://snyk.io/vuln/SNYK-JS-PASSPORT-2840631\n- https://github.com/advisories/GHSA-v923-w3x8-wh69","created":"2022-07-02T00:00:19.000Z","id":1093639,"npm_advisory_id":null,"overview":"This affects the package passport before 0.6.0. When a user logs in or logs out, the session is regenerated instead of being closed.","reported_by":null,"title":"Passport vulnerable to session regeneration when a users logs in or out","metadata":null,"cves":["CVE-2022-25896"],"access":"public","severity":"moderate","module_name":"passport","vulnerable_versions":"<0.6.0","github_advisory_id":"GHSA-v923-w3x8-wh69","recommendation":"Upgrade to version 0.6.0 or later","patched_versions":">=0.6.0","updated":"2023-09-11T16:22:18.000Z","cvss":{"score":4.8,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L"},"cwe":["CWE-384"],"url":"https://github.com/advisories/GHSA-v923-w3x8-wh69"},"1094599":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2023-30533\n- https://cdn.sheetjs.com/advisories/CVE-2023-30533\n- https://git.sheetjs.com/sheetjs/sheetjs/src/branch/master/CHANGELOG.md\n- https://git.sheetjs.com/sheetjs/sheetjs/issues/2667\n- https://git.sheetjs.com/sheetjs/sheetjs/issues/2986\n- https://github.com/advisories/GHSA-4r6h-8v6p-xvw6","created":"2023-04-24T09:30:19.000Z","id":1094599,"npm_advisory_id":null,"overview":"All versions of SheetJS CE through 0.19.2 are vulnerable to \"Prototype Pollution\" when reading specially crafted files. Workflows that do not read arbitrary files (for example, exporting data to spreadsheet files) are unaffected.\n\nA non-vulnerable version cannot be found via npm, as the repository hosted on GitHub and the npm package `xlsx` are no longer maintained.","reported_by":null,"title":"Prototype Pollution in sheetJS","metadata":null,"cves":["CVE-2023-30533"],"access":"public","severity":"high","module_name":"xlsx","vulnerable_versions":"<0.19.3","github_advisory_id":"GHSA-4r6h-8v6p-xvw6","recommendation":"Upgrade to version 0.19.3 or later","patched_versions":">=0.19.3","updated":"2023-11-06T05:04:13.000Z","cvss":{"score":7.8,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"},"cwe":["CWE-1321"],"url":"https://github.com/advisories/GHSA-4r6h-8v6p-xvw6"},"1095051":{"findings":[{"version":"0.7.0","paths":["ngx-md>marked"]}],"found_by":null,"deleted":null,"references":"- https://github.com/markedjs/marked/security/advisories/GHSA-rrrm-qjm4-v8hf\n- https://nvd.nist.gov/vuln/detail/CVE-2022-21680\n- https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0\n- https://github.com/markedjs/marked/releases/tag/v4.0.10\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/\n- https://github.com/advisories/GHSA-rrrm-qjm4-v8hf","created":"2022-01-14T21:04:41.000Z","id":1095051,"npm_advisory_id":null,"overview":"### Impact\n\n_What kind of vulnerability is it?_\n\nDenial of service.\n\nThe regular expression `block.def` may cause catastrophic backtracking against some strings.\nPoC is the following.\n\n```javascript\nimport * as marked from \"marked\";\n\nmarked.parse(`[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} x`);\n```\n\n_Who is impacted?_\n\nAnyone who runs untrusted markdown through marked and does not use a worker with a time limit.\n\n### Patches\n\n_Has the problem been patched?_\n\nYes\n\n_What versions should users upgrade to?_\n\n4.0.10\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nDo not run untrusted markdown through marked or run marked on a [worker](https://marked.js.org/using_advanced#workers) thread and set a reasonable time limit to prevent draining resources.\n\n### References\n\n_Are there any links users can visit to find out more?_\n\n- https://marked.js.org/using_advanced#workers\n- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [marked](https://github.com/markedjs/marked)\n","reported_by":null,"title":"Inefficient Regular Expression Complexity in marked","metadata":null,"cves":["CVE-2022-21680"],"access":"public","severity":"high","module_name":"marked","vulnerable_versions":"<4.0.10","github_advisory_id":"GHSA-rrrm-qjm4-v8hf","recommendation":"Upgrade to version 4.0.10 or later","patched_versions":">=4.0.10","updated":"2023-11-29T20:51:52.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-400","CWE-1333"],"url":"https://github.com/advisories/GHSA-rrrm-qjm4-v8hf"},"1095052":{"findings":[{"version":"0.7.0","paths":["ngx-md>marked"]}],"found_by":null,"deleted":null,"references":"- https://github.com/markedjs/marked/security/advisories/GHSA-5v2h-r2cx-5xgj\n- https://nvd.nist.gov/vuln/detail/CVE-2022-21681\n- https://github.com/markedjs/marked/commit/8f806573a3f6c6b7a39b8cdb66ab5ebb8d55a5f5\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/\n- https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0\n- https://github.com/advisories/GHSA-5v2h-r2cx-5xgj","created":"2022-01-14T21:04:46.000Z","id":1095052,"npm_advisory_id":null,"overview":"### Impact\n\n_What kind of vulnerability is it?_\n\nDenial of service.\n\nThe regular expression `inline.reflinkSearch` may cause catastrophic backtracking against some strings.\nPoC is the following.\n\n```javascript\nimport * as marked from 'marked';\n\nconsole.log(marked.parse(`[x]: x\n\n\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](\\\\[\\\\](`));\n```\n\n_Who is impacted?_\n\nAnyone who runs untrusted markdown through marked and does not use a worker with a time limit.\n\n### Patches\n\n_Has the problem been patched?_\n\nYes\n\n_What versions should users upgrade to?_\n\n4.0.10\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nDo not run untrusted markdown through marked or run marked on a [worker](https://marked.js.org/using_advanced#workers) thread and set a reasonable time limit to prevent draining resources.\n\n### References\n\n_Are there any links users can visit to find out more?_\n\n- https://marked.js.org/using_advanced#workers\n- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [marked](https://github.com/markedjs/marked)\n","reported_by":null,"title":"Inefficient Regular Expression Complexity in marked","metadata":null,"cves":["CVE-2022-21681"],"access":"public","severity":"high","module_name":"marked","vulnerable_versions":"<4.0.10","github_advisory_id":"GHSA-5v2h-r2cx-5xgj","recommendation":"Upgrade to version 4.0.10 or later","patched_versions":">=4.0.10","updated":"2023-11-29T20:51:17.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-5v2h-r2cx-5xgj"},"1095126":{"findings":[{"version":"0.8.4","paths":["git-rev-sync>shelljs"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2022-0144\n- https://github.com/shelljs/shelljs/commit/d919d22dd6de385edaa9d90313075a77f74b338c\n- https://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c\n- https://github.com/advisories/GHSA-4rq4-32rv-6wp6","created":"2022-01-21T23:37:28.000Z","id":1095126,"npm_advisory_id":null,"overview":"shelljs is vulnerable to Improper Privilege Management","reported_by":null,"title":"Improper Privilege Management in shelljs","metadata":null,"cves":["CVE-2022-0144"],"access":"public","severity":"high","module_name":"shelljs","vulnerable_versions":"<0.8.5","github_advisory_id":"GHSA-4rq4-32rv-6wp6","recommendation":"Upgrade to version 0.8.5 or later","patched_versions":">=0.8.5","updated":"2023-11-29T22:21:11.000Z","cvss":{"score":7.1,"vectorString":"CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H"},"cwe":["CWE-269"],"url":"https://github.com/advisories/GHSA-4rq4-32rv-6wp6"},"1095531":{"findings":[{"version":"6.2.1","paths":["log4js"]}],"found_by":null,"deleted":null,"references":"- https://github.com/log4js-node/log4js-node/security/advisories/GHSA-82v2-mx6x-wq7q\n- https://github.com/log4js-node/log4js-node/pull/1141/commits/8042252861a1b65adb66931fdf702ead34fa9b76\n- https://github.com/log4js-node/streamroller/pull/87\n- https://github.com/log4js-node/log4js-node/blob/v6.4.0/CHANGELOG.md#640\n- https://nvd.nist.gov/vuln/detail/CVE-2022-21704\n- https://lists.debian.org/debian-lts-announce/2022/12/msg00014.html\n- https://github.com/advisories/GHSA-82v2-mx6x-wq7q","created":"2022-01-21T18:53:27.000Z","id":1095531,"npm_advisory_id":null,"overview":"### Impact\r\nDefault file permissions for log files created by the file, fileSync and dateFile appenders are world-readable (in unix). This could cause problems if log files contain sensitive information. This would affect any users that have not supplied their own permissions for the files via the mode parameter in the config.\r\n\r\n### Patches\r\nFixed by:\r\n* https://github.com/log4js-node/log4js-node/pull/1141\r\n* https://github.com/log4js-node/streamroller/pull/87\r\n\r\nReleased to NPM in log4js@6.4.0\r\n\r\n### Workarounds\r\nEvery version of log4js published allows passing the mode parameter to the configuration of file appenders, see the documentation for details.\r\n\r\n### References\r\n\r\nThanks to [ranjit-git](https://www.huntr.dev/users/ranjit-git) for raising the issue, and to @lamweili for fixing the problem.\r\n\r\n### For more information\r\nIf you have any questions or comments about this advisory:\r\n* Open an issue in [logj4s-node](https://github.com/log4js-node/log4js-node)\r\n* Ask a question in the [slack channel](https://join.slack.com/t/log4js-node/shared_invite/enQtODkzMDQ3MzExMDczLWUzZmY0MmI0YWI1ZjFhODY0YjI0YmU1N2U5ZTRkOTYyYzg3MjY5NWI4M2FjZThjYjdiOGM0NjU2NzBmYTJjOGI)\r\n* Email us at [gareth.nomiddlename@gmail.com](mailto:gareth.nomiddlename@gmail.com)\r\n","reported_by":null,"title":"Incorrect Default Permissions in log4js","metadata":null,"cves":["CVE-2022-21704"],"access":"public","severity":"moderate","module_name":"log4js","vulnerable_versions":"<6.4.0","github_advisory_id":"GHSA-82v2-mx6x-wq7q","recommendation":"Upgrade to version 6.4.0 or later","patched_versions":">=6.4.0","updated":"2024-01-24T08:54:14.000Z","cvss":{"score":5.5,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"},"cwe":["CWE-276"],"url":"https://github.com/advisories/GHSA-82v2-mx6x-wq7q"},"1096832":{"findings":[{"version":"1.28.2","paths":["@hmcts/rpx-xui-node-lib>openid-client>jose"]}],"found_by":null,"deleted":null,"references":"- https://github.com/panva/jose/security/advisories/GHSA-hhhv-q57g-882q\n- https://github.com/panva/jose/commit/02a65794f7873cdaf12e81e80ad076fcdc4a9314\n- https://github.com/panva/jose/commit/1b91d88d2f8233f3477a5f4579aa5f8057b2ee8b\n- https://nvd.nist.gov/vuln/detail/CVE-2024-28176\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XJDO5VSIAOGT2WP63AXAAWNRSVJCNCRH\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KXKGNCRU7OTM5AHC7YIYBNOWI742PRMY\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/I6MMWFBOXJA6ZCXNVPDFJ4XMK5PVG5RG\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UJO2U5ACZVACNQXJ5EBRFLFW6DP5BROY\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UG5FSEYJ3GP27FZXC5YAAMMEC5XWKJHG\n- https://github.com/advisories/GHSA-hhhv-q57g-882q","created":"2024-03-07T17:40:57.000Z","id":1096832,"npm_advisory_id":null,"overview":"A vulnerability has been identified in the JSON Web Encryption (JWE) decryption interfaces, specifically related to the [support for decompressing plaintext after its decryption](https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.3). This allows an adversary to exploit specific scenarios where the compression ratio becomes exceptionally high. As a result, the length of the JWE token, which is determined by the compressed content's size, can land below application-defined limits. In such cases, other existing application level mechanisms for preventing resource exhaustion may be rendered ineffective.\n\nNote that as per [RFC 8725](https://www.rfc-editor.org/rfc/rfc8725.html#name-avoid-compression-of-encryp) compression of data SHOULD NOT be done before encryption, because such compressed data often reveals information about the plaintext. For this reason the v5.x major version of `jose` removed support for compressed payloads entirely and is therefore NOT affected by this advisory.\n\n### Impact\n\nUnder certain conditions it is possible to have the user's environment consume unreasonable amount of CPU time or memory during JWE Decryption operations.\n\n### Affected users\n\nThe impact is limited only to Node.js users utilizing the JWE decryption APIs to decrypt JWEs from untrusted sources.\n\nYou are NOT affected if any of the following applies to you\n\n- Your code uses jose version v5.x where JWE Compression is not supported anymore\n- Your code runs in an environment other than Node.js (e.g. Deno, CF Workers), which is the only runtime where JWE Compression is implemented out of the box\n- Your code does not use the JWE decryption APIs\n- Your code only accepts JWEs produced by trusted sources\n\n### Patches\n\n`v2.0.7` and `v4.15.5` releases limit the decompression routine to only allow decompressing up to 250 kB of plaintext. In v4.x it is possible to further adjust this limit via the `inflateRaw` decryption option implementation. In v2.x it is possible to further adjust this limit via the `inflateRawSyncLimit` decryption option.\n\n### Workarounds\n\nIf you cannot upgrade and do not want to support compressed JWEs you may detect and reject these tokens early by checking the token's protected header\n\n```js\nconst { zip } = jose.decodeProtectedHeader(token)\nif (zip !== undefined) {\n throw new Error('JWE Compression is not supported')\n}\n```\n\nIf you wish to continue supporting JWEs with compressed payloads in these legacy release lines you must upgrade (v1.x and v2.x to version v2.0.7, v3.x and v4.x to version v4.15.5) and review the limits put forth by the patched releases.\n\n### For more information\nIf you have any questions or comments about this advisory please open a discussion in the project's [repository](https://github.com/panva/jose/discussions/new?category=q-a&title=GHSA-hhhv-q57g-882q%20advisory%20question)","reported_by":null,"title":"jose vulnerable to resource exhaustion via specifically crafted JWE with compressed plaintext","metadata":null,"cves":["CVE-2024-28176"],"access":"public","severity":"moderate","module_name":"jose","vulnerable_versions":"<2.0.7","github_advisory_id":"GHSA-hhhv-q57g-882q","recommendation":"Upgrade to version 2.0.7 or later","patched_versions":">=2.0.7","updated":"2024-03-30T06:30:42.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"cwe":["CWE-400"],"url":"https://github.com/advisories/GHSA-hhhv-q57g-882q"},"1096911":{"findings":[{"version":"0.15.6","paths":["xlsx"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-22363\n- https://cdn.sheetjs.com/advisories/CVE-2024-22363\n- https://cwe.mitre.org/data/definitions/1333.html\n- https://git.sheetjs.com/sheetjs/sheetjs/src/tag/v0.20.2\n- https://github.com/advisories/GHSA-5pgg-2g8v-p4x9","created":"2024-04-05T06:30:46.000Z","id":1096911,"npm_advisory_id":null,"overview":"SheetJS Community Edition before 0.20.2 is vulnerable.to Regular Expression Denial of Service (ReDoS).","reported_by":null,"title":"SheetJS Regular Expression Denial of Service (ReDoS)","metadata":null,"cves":["CVE-2024-22363"],"access":"public","severity":"high","module_name":"xlsx","vulnerable_versions":"<0.20.2","github_advisory_id":"GHSA-5pgg-2g8v-p4x9","recommendation":"Upgrade to version 0.20.2 or later","patched_versions":">=0.20.2","updated":"2024-04-08T13:47:06.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-5pgg-2g8v-p4x9"},"1097504":{"findings":[{"version":"2.5.207","paths":["pdfjs-dist","@hmcts/media-viewer>pdfjs-dist"]}],"found_by":null,"deleted":null,"references":"- https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq\n- https://github.com/mozilla/pdf.js/pull/18015\n- https://github.com/mozilla/pdf.js/commit/85e64b5c16c9aaef738f421733c12911a441cec6\n- https://bugzilla.mozilla.org/show_bug.cgi?id=1893645\n- https://nvd.nist.gov/vuln/detail/CVE-2024-4367\n- https://lists.debian.org/debian-lts-announce/2024/05/msg00010.html\n- https://lists.debian.org/debian-lts-announce/2024/05/msg00012.html\n- https://www.mozilla.org/security/advisories/mfsa2024-21\n- https://www.mozilla.org/security/advisories/mfsa2024-22\n- https://www.mozilla.org/security/advisories/mfsa2024-23\n- https://github.com/advisories/GHSA-wgrm-67xf-hhpq","created":"2024-05-07T10:25:08.000Z","id":1097504,"npm_advisory_id":null,"overview":"### Impact\nIf pdf.js is used to load a malicious PDF, and PDF.js is configured with `isEvalSupported` set to `true` (which is the default value), unrestricted attacker-controlled JavaScript will be executed in the context of the hosting domain.\n\n### Patches\nThe patch removes the use of `eval`:\nhttps://github.com/mozilla/pdf.js/pull/18015\n\n### Workarounds\nSet the option `isEvalSupported` to `false`. \n\n### References\nhttps://bugzilla.mozilla.org/show_bug.cgi?id=1893645","reported_by":null,"title":"PDF.js vulnerable to arbitrary JavaScript execution upon opening a malicious PDF","metadata":null,"cves":["CVE-2024-4367"],"access":"public","severity":"high","module_name":"pdfjs-dist","vulnerable_versions":"<=4.1.392","github_advisory_id":"GHSA-wgrm-67xf-hhpq","recommendation":"Upgrade to version 4.2.67 or later","patched_versions":">=4.2.67","updated":"2024-06-10T20:18:19.000Z","cvss":{"score":0,"vectorString":null},"cwe":[],"url":"https://github.com/advisories/GHSA-wgrm-67xf-hhpq"},"1097679":{"findings":[{"version":"0.26.1","paths":["axios","@hmcts/rpx-xui-node-lib>axios"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2023-45857\n- https://github.com/axios/axios/issues/6006\n- https://github.com/axios/axios/issues/6022\n- https://github.com/axios/axios/pull/6028\n- https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0\n- https://github.com/axios/axios/releases/tag/v1.6.0\n- https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459\n- https://github.com/axios/axios/pull/6091\n- https://github.com/axios/axios/commit/2755df562b9c194fba6d8b609a383443f6a6e967\n- https://github.com/axios/axios/releases/tag/v0.28.0\n- https://security.netapp.com/advisory/ntap-20240621-0006\n- https://github.com/advisories/GHSA-wf5p-g6vw-rhxx","created":"2023-11-08T21:30:37.000Z","id":1097679,"npm_advisory_id":null,"overview":"An issue discovered in Axios 0.8.1 through 1.5.1 inadvertently reveals the confidential XSRF-TOKEN stored in cookies by including it in the HTTP header X-XSRF-TOKEN for every request made to any host allowing attackers to view sensitive information.","reported_by":null,"title":"Axios Cross-Site Request Forgery Vulnerability","metadata":null,"cves":["CVE-2023-45857"],"access":"public","severity":"moderate","module_name":"axios","vulnerable_versions":">=0.8.1 <0.28.0","github_advisory_id":"GHSA-wf5p-g6vw-rhxx","recommendation":"Upgrade to version 0.28.0 or later","patched_versions":">=0.28.0","updated":"2024-06-21T21:33:58.000Z","cvss":{"score":6.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"},"cwe":["CWE-352"],"url":"https://github.com/advisories/GHSA-wf5p-g6vw-rhxx"},"1097682":{"findings":[{"version":"2.5.0","paths":["rx-polling-hmcts>jest-environment-jsdom>jsdom>tough-cookie"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2023-26136\n- https://github.com/salesforce/tough-cookie/issues/282\n- https://github.com/salesforce/tough-cookie/commit/12d474791bb856004e858fdb1c47b7608d09cf6e\n- https://github.com/salesforce/tough-cookie/releases/tag/v4.1.3\n- https://security.snyk.io/vuln/SNYK-JS-TOUGHCOOKIE-5672873\n- https://lists.debian.org/debian-lts-announce/2023/07/msg00010.html\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3HUE6ZR5SL73KHL7XUPAOEL6SB7HUDT2\n- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6PVVPNSAGSDS63HQ74PJ7MZ3MU5IYNVZ\n- https://security.netapp.com/advisory/ntap-20240621-0006\n- https://github.com/advisories/GHSA-72xf-g2v4-qvf3","created":"2023-07-01T06:30:16.000Z","id":1097682,"npm_advisory_id":null,"overview":"Versions of the package tough-cookie before 4.1.3 are vulnerable to Prototype Pollution due to improper handling of Cookies when using CookieJar in `rejectPublicSuffixes=false` mode. This issue arises from the manner in which the objects are initialized.","reported_by":null,"title":"tough-cookie Prototype Pollution vulnerability","metadata":null,"cves":["CVE-2023-26136"],"access":"public","severity":"moderate","module_name":"tough-cookie","vulnerable_versions":"<4.1.3","github_advisory_id":"GHSA-72xf-g2v4-qvf3","recommendation":"Upgrade to version 4.1.3 or later","patched_versions":">=4.1.3","updated":"2024-06-21T21:33:53.000Z","cvss":{"score":6.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"},"cwe":["CWE-1321"],"url":"https://github.com/advisories/GHSA-72xf-g2v4-qvf3"},"1097684":{"findings":[{"version":"8.5.1","paths":["jsonwebtoken"]}],"found_by":null,"deleted":null,"references":"- https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-qwph-4952-7xr6\n- https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3\n- https://nvd.nist.gov/vuln/detail/CVE-2022-23540\n- https://security.netapp.com/advisory/ntap-20240621-0007\n- https://github.com/advisories/GHSA-qwph-4952-7xr6","created":"2022-12-22T03:32:59.000Z","id":1097684,"npm_advisory_id":null,"overview":"# Overview\n\nIn versions <=8.5.1 of jsonwebtoken library, lack of algorithm definition and a falsy secret or key in the `jwt.verify()` function can lead to signature validation bypass due to defaulting to the `none` algorithm for signature verification.\n\n# Am I affected?\nYou will be affected if all the following are true in the `jwt.verify()` function:\n- a token with no signature is received\n- no algorithms are specified \n- a falsy (e.g. null, false, undefined) secret or key is passed \n\n# How do I fix it?\n \nUpdate to version 9.0.0 which removes the default support for the none algorithm in the `jwt.verify()` method. \n\n# Will the fix impact my users?\n\nThere will be no impact, if you update to version 9.0.0 and you don’t need to allow for the `none` algorithm. If you need 'none' algorithm, you have to explicitly specify that in `jwt.verify()` options.\n","reported_by":null,"title":"jsonwebtoken vulnerable to signature validation bypass due to insecure default algorithm in jwt.verify()","metadata":null,"cves":["CVE-2022-23540"],"access":"public","severity":"moderate","module_name":"jsonwebtoken","vulnerable_versions":"<9.0.0","github_advisory_id":"GHSA-qwph-4952-7xr6","recommendation":"Upgrade to version 9.0.0 or later","patched_versions":">=9.0.0","updated":"2024-06-21T21:34:57.000Z","cvss":{"score":6.4,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L"},"cwe":["CWE-287","CWE-327","CWE-347"],"url":"https://github.com/advisories/GHSA-qwph-4952-7xr6"},"1097690":{"findings":[{"version":"8.5.1","paths":["jsonwebtoken"]}],"found_by":null,"deleted":null,"references":"- https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-8cf7-32gw-wr33\n- https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3\n- https://nvd.nist.gov/vuln/detail/CVE-2022-23539\n- https://security.netapp.com/advisory/ntap-20240621-0007\n- https://github.com/advisories/GHSA-8cf7-32gw-wr33","created":"2022-12-22T03:32:22.000Z","id":1097690,"npm_advisory_id":null,"overview":"# Overview\n\nVersions `<=8.5.1` of `jsonwebtoken` library could be misconfigured so that legacy, insecure key types are used for signature verification. For example, DSA keys could be used with the RS256 algorithm. \n\n# Am I affected?\n\nYou are affected if you are using an algorithm and a key type other than the combinations mentioned below\n\n| Key type | algorithm |\n|----------|------------------------------------------|\n| ec | ES256, ES384, ES512 |\n| rsa | RS256, RS384, RS512, PS256, PS384, PS512 |\n| rsa-pss | PS256, PS384, PS512 |\n\nAnd for Elliptic Curve algorithms:\n\n| `alg` | Curve |\n|-------|------------|\n| ES256 | prime256v1 |\n| ES384 | secp384r1 |\n| ES512 | secp521r1 |\n\n# How do I fix it?\n\nUpdate to version 9.0.0. This version validates for asymmetric key type and algorithm combinations. Please refer to the above mentioned algorithm / key type combinations for the valid secure configuration. After updating to version 9.0.0, If you still intend to continue with signing or verifying tokens using invalid key type/algorithm value combinations, you’ll need to set the `allowInvalidAsymmetricKeyTypes` option to `true` in the `sign()` and/or `verify()` functions.\n\n# Will the fix impact my users?\n\nThere will be no impact, if you update to version 9.0.0 and you already use a valid secure combination of key type and algorithm. Otherwise, use the `allowInvalidAsymmetricKeyTypes` option to `true` in the `sign()` and `verify()` functions to continue usage of invalid key type/algorithm combination in 9.0.0 for legacy compatibility. \n\n","reported_by":null,"title":"jsonwebtoken unrestricted key type could lead to legacy keys usage ","metadata":null,"cves":["CVE-2022-23539"],"access":"public","severity":"high","module_name":"jsonwebtoken","vulnerable_versions":"<=8.5.1","github_advisory_id":"GHSA-8cf7-32gw-wr33","recommendation":"Upgrade to version 9.0.0 or later","patched_versions":">=9.0.0","updated":"2024-06-24T21:23:39.000Z","cvss":{"score":8.1,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"},"cwe":["CWE-327"],"url":"https://github.com/advisories/GHSA-8cf7-32gw-wr33"},"1097694":{"findings":[{"version":"8.5.1","paths":["jsonwebtoken"]}],"found_by":null,"deleted":null,"references":"- https://github.com/auth0/node-jsonwebtoken/security/advisories/GHSA-hjrf-2m68-5959\n- https://github.com/auth0/node-jsonwebtoken/commit/e1fa9dcc12054a8681db4e6373da1b30cf7016e3\n- https://nvd.nist.gov/vuln/detail/CVE-2022-23541\n- https://github.com/auth0/node-jsonwebtoken/releases/tag/v9.0.0\n- https://security.netapp.com/advisory/ntap-20240621-0007\n- https://github.com/advisories/GHSA-hjrf-2m68-5959","created":"2022-12-22T03:33:19.000Z","id":1097694,"npm_advisory_id":null,"overview":"# Overview\n\nVersions `<=8.5.1` of `jsonwebtoken` library can be misconfigured so that passing a poorly implemented key retrieval function (referring to the `secretOrPublicKey` argument from the [readme link](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback)) will result in incorrect verification of tokens. There is a possibility of using a different algorithm and key combination in verification than the one that was used to sign the tokens. Specifically, tokens signed with an asymmetric public key could be verified with a symmetric HS256 algorithm. This can lead to successful validation of forged tokens. \n\n# Am I affected?\n\nYou will be affected if your application is supporting usage of both symmetric key and asymmetric key in jwt.verify() implementation with the same key retrieval function. \n\n# How do I fix it?\n \nUpdate to version 9.0.0.\n\n# Will the fix impact my users?\n\nThere is no impact for end users","reported_by":null,"title":"jsonwebtoken's insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC","metadata":null,"cves":["CVE-2022-23541"],"access":"public","severity":"moderate","module_name":"jsonwebtoken","vulnerable_versions":"<=8.5.1","github_advisory_id":"GHSA-hjrf-2m68-5959","recommendation":"Upgrade to version 9.0.0 or later","patched_versions":">=9.0.0","updated":"2024-06-24T21:24:07.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L"},"cwe":["CWE-287","CWE-1259"],"url":"https://github.com/advisories/GHSA-hjrf-2m68-5959"},"1098366":{"findings":[{"version":"2.7.4","paths":["ejs"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-33883\n- https://github.com/mde/ejs/commit/e469741dca7df2eb400199e1cdb74621e3f89aa5\n- https://github.com/mde/ejs/compare/v3.1.9...v3.1.10\n- https://security.netapp.com/advisory/ntap-20240605-0003\n- https://github.com/advisories/GHSA-ghr5-ch3p-vcr6","created":"2024-04-28T18:30:31.000Z","id":1098366,"npm_advisory_id":null,"overview":"The ejs (aka Embedded JavaScript templates) package before 3.1.10 for Node.js lacks certain pollution protection.","reported_by":null,"title":"ejs lacks certain pollution protection","metadata":null,"cves":["CVE-2024-33883"],"access":"public","severity":"moderate","module_name":"ejs","vulnerable_versions":"<3.1.10","github_advisory_id":"GHSA-ghr5-ch3p-vcr6","recommendation":"Upgrade to version 3.1.10 or later","patched_versions":">=3.1.10","updated":"2024-08-02T15:45:54.000Z","cvss":{"score":4,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"cwe":["CWE-693","CWE-1321"],"url":"https://github.com/advisories/GHSA-ghr5-ch3p-vcr6"},"1098393":{"findings":[{"version":"7.4.6","paths":["puppeteer>ws","@hmcts/media-viewer>socket.io-client>engine.io-client>ws"]}],"found_by":null,"deleted":null,"references":"- https://github.com/websockets/ws/security/advisories/GHSA-3h5v-q93c-6h6q\n- https://github.com/websockets/ws/issues/2230\n- https://github.com/websockets/ws/pull/2231\n- https://github.com/websockets/ws/commit/22c28763234aa75a7e1b76f5c01c181260d7917f\n- https://github.com/websockets/ws/commit/4abd8f6de4b0b65ef80b3ff081989479ed93377e\n- https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c\n- https://github.com/websockets/ws/commit/eeb76d313e2a00dd5247ca3597bba7877d064a63\n- https://github.com/advisories/GHSA-3h5v-q93c-6h6q","created":"2024-06-17T19:09:10.000Z","id":1098393,"npm_advisory_id":null,"overview":"### Impact\n\nA request with a number of headers exceeding the[`server.maxHeadersCount`][] threshold could be used to crash a ws server.\n\n### Proof of concept\n\n```js\nconst http = require('http');\nconst WebSocket = require('ws');\n\nconst wss = new WebSocket.Server({ port: 0 }, function () {\n const chars = \"!#$%&'*+-.0123456789abcdefghijklmnopqrstuvwxyz^_`|~\".split('');\n const headers = {};\n let count = 0;\n\n for (let i = 0; i < chars.length; i++) {\n if (count === 2000) break;\n\n for (let j = 0; j < chars.length; j++) {\n const key = chars[i] + chars[j];\n headers[key] = 'x';\n\n if (++count === 2000) break;\n }\n }\n\n headers.Connection = 'Upgrade';\n headers.Upgrade = 'websocket';\n headers['Sec-WebSocket-Key'] = 'dGhlIHNhbXBsZSBub25jZQ==';\n headers['Sec-WebSocket-Version'] = '13';\n\n const request = http.request({\n headers: headers,\n host: '127.0.0.1',\n port: wss.address().port\n });\n\n request.end();\n});\n```\n\n### Patches\n\nThe vulnerability was fixed in ws@8.17.1 (https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c) and backported to ws@7.5.10 (https://github.com/websockets/ws/commit/22c28763234aa75a7e1b76f5c01c181260d7917f), ws@6.2.3 (https://github.com/websockets/ws/commit/eeb76d313e2a00dd5247ca3597bba7877d064a63), and ws@5.2.4 (https://github.com/websockets/ws/commit/4abd8f6de4b0b65ef80b3ff081989479ed93377e)\n\n### Workarounds\n\nIn vulnerable versions of ws, the issue can be mitigated in the following ways:\n\n1. Reduce the maximum allowed length of the request headers using the [`--max-http-header-size=size`][] and/or the [`maxHeaderSize`][] options so that no more headers than the `server.maxHeadersCount` limit can be sent.\n2. Set `server.maxHeadersCount` to `0` so that no limit is applied.\n\n### Credits\n\nThe vulnerability was reported by [Ryan LaPointe](https://github.com/rrlapointe) in https://github.com/websockets/ws/issues/2230.\n\n### References\n\n- https://github.com/websockets/ws/issues/2230\n- https://github.com/websockets/ws/pull/2231\n\n[`--max-http-header-size=size`]: https://nodejs.org/api/cli.html#--max-http-header-sizesize\n[`maxHeaderSize`]: https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener\n[`server.maxHeadersCount`]: https://nodejs.org/api/http.html#servermaxheaderscount\n","reported_by":null,"title":"ws affected by a DoS when handling a request with many HTTP headers","metadata":null,"cves":["CVE-2024-37890"],"access":"public","severity":"high","module_name":"ws","vulnerable_versions":">=7.0.0 <7.5.10","github_advisory_id":"GHSA-3h5v-q93c-6h6q","recommendation":"Upgrade to version 7.5.10 or later","patched_versions":">=7.5.10","updated":"2024-08-05T05:02:34.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-476"],"url":"https://github.com/advisories/GHSA-3h5v-q93c-6h6q"},"1098681":{"findings":[{"version":"4.0.5","paths":["http-proxy-middleware>micromatch","@hmcts/rpx-xui-node-lib>ts-auto-mock>micromatch","@hmcts/rpx-xui-node-lib>jest-ts-auto-mock>ts-auto-mock>micromatch","rx-polling-hmcts>jest-environment-jsdom>@jest/fake-timers>jest-message-util>micromatch","rx-polling-hmcts>jest-environment-jsdom>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runtime>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runner>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>@jest/core>jest-runner>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>@jest/core>jest-runner>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>@jest/core>jest-config>jest-runner>jest-runtime>@jest/globals>@jest/environment>@jest/fake-timers>jest-message-util>micromatch","@hmcts/rpx-xui-node-lib>jest-mock-axios>jest>jest-cli>@jest/core>jest-config>jest-runner>jest-runtime>@jest/globals>@jest/expect>jest-snapshot>expect>jest-message-util>micromatch"]}],"found_by":null,"deleted":null,"references":"- https://nvd.nist.gov/vuln/detail/CVE-2024-4067\n- https://github.com/micromatch/micromatch/issues/243\n- https://github.com/micromatch/micromatch/pull/247\n- https://devhub.checkmarx.com/cve-details/CVE-2024-4067\n- https://github.com/micromatch/micromatch/blob/2c56a8604b68c1099e7bc0f807ce0865a339747a/index.js#L448\n- https://github.com/micromatch/micromatch/commit/500d5d6f42f0e8dfa1cb5464c6cb420b1b6aaaa0\n- https://github.com/micromatch/micromatch/pull/266\n- https://github.com/micromatch/micromatch/commit/03aa8052171e878897eee5d7bb2ae0ae83ec2ade\n- https://advisory.checkmarx.net/advisory/CVE-2024-4067\n- https://github.com/micromatch/micromatch/releases/tag/4.0.8\n- https://github.com/advisories/GHSA-952p-6rrq-rcjv","created":"2024-05-14T18:30:54.000Z","id":1098681,"npm_advisory_id":null,"overview":"The NPM package `micromatch` prior to version 4.0.8 is vulnerable to Regular Expression Denial of Service (ReDoS). The vulnerability occurs in `micromatch.braces()` in `index.js` because the pattern `.*` will greedily match anything. By passing a malicious payload, the pattern matching will keep backtracking to the input while it doesn't find the closing bracket. As the input size increases, the consumption time will also increase until it causes the application to hang or slow down. There was a merged fix but further testing shows the issue persisted prior to https://github.com/micromatch/micromatch/pull/266. This issue should be mitigated by using a safe pattern that won't start backtracking the regular expression due to greedy matching.\n","reported_by":null,"title":"Regular Expression Denial of Service (ReDoS) in micromatch","metadata":null,"cves":["CVE-2024-4067"],"access":"public","severity":"moderate","module_name":"micromatch","vulnerable_versions":"<4.0.8","github_advisory_id":"GHSA-952p-6rrq-rcjv","recommendation":"Upgrade to version 4.0.8 or later","patched_versions":">=4.0.8","updated":"2024-08-28T13:12:27.000Z","cvss":{"score":5.3,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-952p-6rrq-rcjv"},"1099520":{"findings":[{"version":"1.20.2","paths":["body-parser","express>body-parser","@hmcts/rpx-xui-node-lib>express>body-parser"]}],"found_by":null,"deleted":null,"references":"- https://github.com/expressjs/body-parser/security/advisories/GHSA-qwcr-r2fm-qrc7\n- https://github.com/expressjs/body-parser/commit/b2695c4450f06ba3b0ccf48d872a229bb41c9bce\n- https://nvd.nist.gov/vuln/detail/CVE-2024-45590\n- https://github.com/advisories/GHSA-qwcr-r2fm-qrc7","created":"2024-09-10T15:52:39.000Z","id":1099520,"npm_advisory_id":null,"overview":"### Impact\n\nbody-parser <1.20.3 is vulnerable to denial of service when url encoding is enabled. A malicious actor using a specially crafted payload could flood the server with a large number of requests, resulting in denial of service.\n\n### Patches\n\nthis issue is patched in 1.20.3\n\n### References\n","reported_by":null,"title":"body-parser vulnerable to denial of service when url encoding is enabled","metadata":null,"cves":["CVE-2024-45590"],"access":"public","severity":"high","module_name":"body-parser","vulnerable_versions":"<1.20.3","github_advisory_id":"GHSA-qwcr-r2fm-qrc7","recommendation":"Upgrade to version 1.20.3 or later","patched_versions":">=1.20.3","updated":"2024-09-10T19:01:11.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-405"],"url":"https://github.com/advisories/GHSA-qwcr-r2fm-qrc7"},"1099525":{"findings":[{"version":"0.18.0","paths":["express>send","@hmcts/rpx-xui-node-lib>express>send","@hmcts/rpx-xui-node-lib>express>serve-static>send"]}],"found_by":null,"deleted":null,"references":"- https://github.com/pillarjs/send/security/advisories/GHSA-m6fv-jmcg-4jfg\n- https://nvd.nist.gov/vuln/detail/CVE-2024-43799\n- https://github.com/pillarjs/send/commit/ae4f2989491b392ae2ef3b0015a019770ae65d35\n- https://github.com/advisories/GHSA-m6fv-jmcg-4jfg","created":"2024-09-10T19:42:41.000Z","id":1099525,"npm_advisory_id":null,"overview":"### Impact\n\npassing untrusted user input - even after sanitizing it - to `SendStream.redirect()` may execute untrusted code\n\n### Patches\n\nthis issue is patched in send 0.19.0\n\n### Workarounds\n\nusers are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist\n\n### Details\n\nsuccessful exploitation of this vector requires the following:\n\n1. The attacker MUST control the input to response.redirect()\n1. express MUST NOT redirect before the template appears\n1. the browser MUST NOT complete redirection before:\n1. the user MUST click on the link in the template\n","reported_by":null,"title":"send vulnerable to template injection that can lead to XSS","metadata":null,"cves":["CVE-2024-43799"],"access":"public","severity":"moderate","module_name":"send","vulnerable_versions":"<0.19.0","github_advisory_id":"GHSA-m6fv-jmcg-4jfg","recommendation":"Upgrade to version 0.19.0 or later","patched_versions":">=0.19.0","updated":"2024-09-10T19:42:42.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L"},"cwe":["CWE-79"],"url":"https://github.com/advisories/GHSA-m6fv-jmcg-4jfg"},"1099527":{"findings":[{"version":"1.15.0","paths":["express>serve-static","@hmcts/rpx-xui-node-lib>express>serve-static"]}],"found_by":null,"deleted":null,"references":"- https://github.com/expressjs/serve-static/security/advisories/GHSA-cm22-4g7w-348p\n- https://nvd.nist.gov/vuln/detail/CVE-2024-43800\n- https://github.com/expressjs/serve-static/commit/0c11fad159898cdc69fd9ab63269b72468ecaf6b\n- https://github.com/expressjs/serve-static/commit/ce730896fddce1588111d9ef6fdf20896de5c6fa\n- https://github.com/advisories/GHSA-cm22-4g7w-348p","created":"2024-09-10T19:42:33.000Z","id":1099527,"npm_advisory_id":null,"overview":"### Impact\n\npassing untrusted user input - even after sanitizing it - to `redirect()` may execute untrusted code\n\n### Patches\n\nthis issue is patched in serve-static 1.16.0\n\n### Workarounds\n\nusers are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist\n\n### Details\n\nsuccessful exploitation of this vector requires the following:\n\n1. The attacker MUST control the input to response.redirect()\n1. express MUST NOT redirect before the template appears\n1. the browser MUST NOT complete redirection before:\n1. the user MUST click on the link in the template\n","reported_by":null,"title":"serve-static vulnerable to template injection that can lead to XSS","metadata":null,"cves":["CVE-2024-43800"],"access":"public","severity":"moderate","module_name":"serve-static","vulnerable_versions":"<1.16.0","github_advisory_id":"GHSA-cm22-4g7w-348p","recommendation":"Upgrade to version 1.16.0 or later","patched_versions":">=1.16.0","updated":"2024-09-10T19:42:34.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L"},"cwe":["CWE-79"],"url":"https://github.com/advisories/GHSA-cm22-4g7w-348p"},"1099529":{"findings":[{"version":"4.19.2","paths":["express","@hmcts/rpx-xui-node-lib>express"]}],"found_by":null,"deleted":null,"references":"- https://github.com/expressjs/express/security/advisories/GHSA-qw6h-vgh9-j6wx\n- https://nvd.nist.gov/vuln/detail/CVE-2024-43796\n- https://github.com/expressjs/express/commit/54271f69b511fea198471e6ff3400ab805d6b553\n- https://github.com/advisories/GHSA-qw6h-vgh9-j6wx","created":"2024-09-10T19:41:04.000Z","id":1099529,"npm_advisory_id":null,"overview":"### Impact\n\nIn express <4.20.0, passing untrusted user input - even after sanitizing it - to `response.redirect()` may execute untrusted code\n\n### Patches\n\nthis issue is patched in express 4.20.0\n\n### Workarounds\n\nusers are encouraged to upgrade to the patched version of express, but otherwise can workaround this issue by making sure any untrusted inputs are safe, ideally by validating them against an explicit allowlist\n\n### Details\n\nsuccessful exploitation of this vector requires the following:\n\n1. The attacker MUST control the input to response.redirect()\n1. express MUST NOT redirect before the template appears\n1. the browser MUST NOT complete redirection before:\n1. the user MUST click on the link in the template\n","reported_by":null,"title":"express vulnerable to XSS via response.redirect()","metadata":null,"cves":["CVE-2024-43796"],"access":"public","severity":"moderate","module_name":"express","vulnerable_versions":"<4.20.0","github_advisory_id":"GHSA-qw6h-vgh9-j6wx","recommendation":"Upgrade to version 4.20.0 or later","patched_versions":">=4.20.0","updated":"2024-09-10T19:41:07.000Z","cvss":{"score":5,"vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L"},"cwe":["CWE-79"],"url":"https://github.com/advisories/GHSA-qw6h-vgh9-j6wx"},"1099562":{"findings":[{"version":"0.1.7","paths":["express>path-to-regexp","@hmcts/rpx-xui-node-lib>express>path-to-regexp"]}],"found_by":null,"deleted":null,"references":"- https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j\n- https://github.com/pillarjs/path-to-regexp/commit/29b96b4a1de52824e1ca0f49a701183cc4ed476f\n- https://github.com/pillarjs/path-to-regexp/commit/60f2121e9b66b7b622cc01080df0aabda9eedee6\n- https://nvd.nist.gov/vuln/detail/CVE-2024-45296\n- https://github.com/pillarjs/path-to-regexp/commit/925ac8e3c5780b02f58cbd4e52f95da8ad2ac485\n- https://github.com/pillarjs/path-to-regexp/commit/d31670ae8f6e69cbfd56e835742195b7d10942ef\n- https://github.com/pillarjs/path-to-regexp/commit/f1253b47b347dcb909e3e80b0eb2649109e59894\n- https://github.com/pillarjs/path-to-regexp/releases/tag/v6.3.0\n- https://github.com/advisories/GHSA-9wv6-86v2-598j","created":"2024-09-09T20:19:15.000Z","id":1099562,"npm_advisory_id":null,"overview":"### Impact\n\nA bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (`.`). For example, `/:a-:b`.\n\n### Patches\n\nFor users of 0.1, upgrade to `0.1.10`. All other users should upgrade to `8.0.0`.\n\nThese versions add backtrack protection when a custom regex pattern is not provided:\n\n- [0.1.10](https://github.com/pillarjs/path-to-regexp/releases/tag/v0.1.10)\n- [1.9.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v1.9.0)\n- [3.3.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v3.3.0)\n- [6.3.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v6.3.0)\n\nThey do not protect against vulnerable user supplied capture groups. Protecting against explicit user patterns is out of scope for old versions and not considered a vulnerability.\n\nVersion [7.1.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v7.1.0) can enable `strict: true` and get an error when the regular expression might be bad.\n\nVersion [8.0.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0) removes the features that can cause a ReDoS.\n\n### Workarounds\n\nAll versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change `/:a-:b` to `/:a-:b([^-/]+)`.\n\nIf paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.\n\n### Details\n\nUsing `/:a-:b` will produce the regular expression `/^\\/([^\\/]+?)-([^\\/]+?)\\/?$/`. This can be exploited by a path such as `/a${'-a'.repeat(8_000)}/a`. [OWASP](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) has a good example of why this occurs, but the TL;DR is the `/a` at the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the `:a-:b` on the repeated 8,000 `-a`.\n\nBecause JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.\n\n### References\n\n* [OWASP](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)\n* [Detailed blog post](https://blakeembrey.com/posts/2024-09-web-redos/)","reported_by":null,"title":"path-to-regexp outputs backtracking regular expressions","metadata":null,"cves":["CVE-2024-45296"],"access":"public","severity":"high","module_name":"path-to-regexp","vulnerable_versions":"<0.1.10","github_advisory_id":"GHSA-9wv6-86v2-598j","recommendation":"Upgrade to version 0.1.10 or later","patched_versions":">=0.1.10","updated":"2024-09-12T17:09:43.000Z","cvss":{"score":7.5,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"cwe":["CWE-1333"],"url":"https://github.com/advisories/GHSA-9wv6-86v2-598j"},"1099846":{"findings":[{"version":"0.4.2","paths":["express-session>cookie","@hmcts/rpx-xui-node-lib>csurf>cookie"]}],"found_by":null,"deleted":null,"references":"- https://github.com/jshttp/cookie/security/advisories/GHSA-pxg6-pf52-xh8x\n- https://github.com/jshttp/cookie/pull/167\n- https://github.com/jshttp/cookie/commit/e10042845354fea83bd8f34af72475eed1dadf5c\n- https://github.com/advisories/GHSA-pxg6-pf52-xh8x","created":"2024-10-04T20:31:00.000Z","id":1099846,"npm_advisory_id":null,"overview":"### Impact\n\nThe cookie name could be used to set other fields of the cookie, resulting in an unexpected cookie value. For example, `serialize(\"userName=; Max-Age=2592000; a\", value)` would result in `\"userName=; Max-Age=2592000; a=test\"`, setting `userName` cookie to `