Skip to content

Bump crypto-js from 4.1.1 to 4.2.0 in /research-hub-web#415

Open
dependabot[bot] wants to merge 2148 commits intomasterfrom
dependabot/npm_and_yarn/research-hub-web/crypto-js-4.2.0
Open

Bump crypto-js from 4.1.1 to 4.2.0 in /research-hub-web#415
dependabot[bot] wants to merge 2148 commits intomasterfrom
dependabot/npm_and_yarn/research-hub-web/crypto-js-4.2.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Oct 25, 2023

Bumps crypto-js from 4.1.1 to 4.2.0.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the Security Alerts page.

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Oct 25, 2023
@dependabot @github
Copy link
Copy Markdown
Contributor Author

dependabot bot commented on behalf of github Oct 25, 2023

Dependabot tried to add @Trombach, @cakr322 and @eric-el-tan as reviewers to this PR, but received the following error from GitHub:

POST https://api.github.com/repos/UoA-eResearch/hub-stack/pulls/415/requested_reviewers: 422 - Reviews may only be requested from collaborators. One or more of the users or teams you specified is not a collaborator of the UoA-eResearch/hub-stack repository. // See: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request

@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/research-hub-web/crypto-js-4.2.0 branch from 30ced6e to 94ac4e2 Compare November 9, 2023 01:31
@lugn621 lugn621 force-pushed the dependabot/npm_and_yarn/research-hub-web/crypto-js-4.2.0 branch from 94ac4e2 to e601f7e Compare April 2, 2026 02:11
Comment on lines +15 to +36
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 18

- name: Install Node.js dependencies
working-directory: ./research-hub-web
run: npm ci --force

- name: Install Angular CLI
run: npm install -g @angular/cli

- name: ng lint
working-directory: ./research-hub-web
run: ng lint

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 6 days ago

In general, the problem is fixed by explicitly setting permissions for the GITHUB_TOKEN either at the workflow root (applies to all jobs) or inside each job, granting only the minimal required scopes, typically contents: read for a pure linting job.

For this specific workflow, the simplest, least intrusive fix is to add a permissions: block at the top level (next to name: and on:), setting contents: read. This documents and enforces that the workflow only needs read access to repository contents, matching its actual behavior (checkout and lint) without changing existing functionality. No imports or external methods are involved because this is purely a YAML configuration change.

Concretely, in .github/workflows/linting.yml, insert:

permissions:
  contents: read

between the name: Lint line and the on: block. No other changes are needed.

Suggested changeset 1
.github/workflows/linting.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml
--- a/.github/workflows/linting.yml
+++ b/.github/workflows/linting.yml
@@ -1,5 +1,8 @@
 name: Lint
 
+permissions:
+  contents: read
+
 on:
   # Trigger the workflow on push or pull request,
   # but only for the main branch
EOF
@@ -1,5 +1,8 @@
name: Lint

permissions:
contents: read

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +14 to +33
name: Create Sentry Release
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Get Branch
id: var
run: echo ::set-output name=branch::${GITHUB_REF#refs/*/}
- name: Output Branch
run: echo ${{ steps.var.outputs.branch }}
- name: Notify Sentry
# https://github.com/getsentry/action-release
uses: getsentry/action-release@v1.1.6
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: university-of-auckland-7o
SENTRY_PROJECT: research-hub
with:
environment: ${{ steps.var.outputs.branch }} No newline at end of file

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 6 days ago

In general, the problem is fixed by adding an explicit permissions block to the workflow or to the specific job, restricting the GITHUB_TOKEN to the minimal required scopes (typically contents: read for workflows that only need to read the repository). This both documents the intended privileges and prevents accidental privilege escalation if org/repo defaults change.

For this specific workflow, the sentry-release job checks out the repository and invokes getsentry/action-release with Sentry credentials. From the snippet, it does not modify GitHub issues, pull requests, or releases directly. The minimal safe permissions are therefore contents: read. The cleanest fix is to add a permissions: block under the sentry-release job definition (after runs-on: ubuntu-latest), setting contents: read. This will not change existing functionality, because read access to repository contents is already implied by current defaults and needed for actions/checkout@v2 to work.

No additional methods, imports, or definitions are necessary—only the new YAML keys within .github/workflows/sentry.yml.

Suggested changeset 1
.github/workflows/sentry.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/sentry.yml b/.github/workflows/sentry.yml
--- a/.github/workflows/sentry.yml
+++ b/.github/workflows/sentry.yml
@@ -13,6 +13,8 @@
   sentry-release:
     name: Create Sentry Release
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
 
     steps:
       - name: Check out Git repository
EOF
@@ -13,6 +13,8 @@
sentry-release:
name: Create Sentry Release
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Check out Git repository
Copilot is powered by AI and may make mistakes. Always verify output.
run: echo ${{ steps.var.outputs.branch }}
- name: Notify Sentry
# https://github.com/getsentry/action-release
uses: getsentry/action-release@v1.1.6

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Sentry Release' step
Uses Step
uses 'getsentry/action-release' with ref 'v1.1.6', not a pinned commit hash

module.exports.search = async (event, context) => {
try {
console.log(`Received query: ${event.body}`);

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.

Copilot Autofix

AI 6 days ago

In general, the fix is to sanitize untrusted data (here, event.body) before including it in log messages. For text logs, the main concern is line breaks and other control characters that can alter the structure of the log output. We should therefore create a sanitized version of event.body with \r and \n removed (and optionally other control characters), and log that instead. This preserves the content for debugging while preventing attackers from injecting extra log lines.

The best minimal fix in this file is to introduce a sanitized local variable right before logging, using String.prototype.replace with a regular expression that strips carriage returns and newlines from event.body, and then use that variable in the console.log call. For example, on line 53 we can change from logging event.body directly to: compute const sanitizedBody = String(event.body).replace(/[\r\n]/g, ''); and log sanitizedBody. Using String(...) guarantees that even if event.body is not a string, the code won’t throw. No new imports are needed; this uses only built-in JavaScript functionality.

Concretely, in hub-search-proxy/handler.js within the module.exports.search function, we will replace the existing console.log line with two lines: one to sanitize the body and one to log the sanitized value. All other behavior in the function remains unchanged.

Suggested changeset 1
hub-search-proxy/handler.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/hub-search-proxy/handler.js b/hub-search-proxy/handler.js
--- a/hub-search-proxy/handler.js
+++ b/hub-search-proxy/handler.js
@@ -50,7 +50,8 @@
 
 module.exports.search = async (event, context) => {
     try {
-        console.log(`Received query: ${event.body}`);
+        const sanitizedBody = String(event.body).replace(/[\r\n]/g, '');
+        console.log(`Received query: ${sanitizedBody}`);
         const requestBody = JSON.parse(event.body);
         let queryString = '';
         let size = 10;
EOF
@@ -50,7 +50,8 @@

module.exports.search = async (event, context) => {
try {
console.log(`Received query: ${event.body}`);
const sanitizedBody = String(event.body).replace(/[\r\n]/g, '');
console.log(`Received query: ${sanitizedBody}`);
const requestBody = JSON.parse(event.body);
let queryString = '';
let size = 10;
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants