Skip to content

Hotfixes release v2025.08.14 - #5300

Merged
bjester merged 851 commits into
hotfixesfrom
unstable
Aug 22, 2025
Merged

Hotfixes release v2025.08.14#5300
bjester merged 851 commits into
hotfixesfrom
unstable

Conversation

@bjester

@bjesterbjester commented Aug 14, 2025

Copy link
Copy Markdown
Member

Summary

PRIssuesCategoryQA Focus
#5083#5063EnhancementTrigger data export from Account settings
#5088#5057, #5058, #5088EnhancementInteract and provide feedback on Search recommendations
#5097#5124Enhancement(skip)
#5103#4878EnhancementPublish a channel
#5106#5093EnhancementVisual check of modal headers
#5125#5111EnhancementChange folder language before using
import modal for importing search recommendations
#5126#5116EnhancementBrowse search recommendations
#5128#5042EnhancementEdit a channel and resources with grade levels
#5144#5115Enhancement(skip)
#5149N/AEnhancementPreview a resource
#5155#5131, #5146, #2178Enhancement(skip)
#5248#5069EnhancementDeploy staged channel
#5253#5211, #4086EnhancementReview selected resources in import modal
#5255N/AEnhancementReview selected resources in import modal
#5261N/AEnhancementBrowse search recommendations
#5040N/ABug fixN/A
#5104#4073Bug fixView channel details
#5147#5065Bug fixN/A
#5102#5068Tech DebtN/A
#4902N/ADevOpsN/A
#5105N/ADevOpsN/A
#5134N/ADevOpsN/A
#5143N/ADevOpsN/A
#5177N/ADevOpsN/A
#5190N/ADevOpsN/A
#5196N/ADevOpsN/A
#5197N/ADevOpsN/A
#5254N/ADevOpsN/A
#5293N/ADevOpsN/A
Dependency PRs
PRCategory
#5076Dependency
#5084Dependency
#5085Dependency
#5086Dependency
#5096Dependency
#5098Dependency
#5099Dependency
#5108Dependency
#5113Dependency
#5117Dependency
#5119Dependency
#5120Dependency
#5121Dependency
#5136Dependency
#5137Dependency
#5139Dependency
#5141Dependency
#5148Dependency
#5152Dependency
#5154Dependency
#5164Dependency
#5179Dependency
#5181Dependency
#5182Dependency
#5198Dependency
#5199Dependency
#5200Dependency
#5201Dependency
#5202Dependency
#5203Dependency
#5204Dependency
#5205Dependency
#5207Dependency
#5210Dependency
#5223Dependency
#5224Dependency
#5226Dependency
#5238Dependency
#5239Dependency
#5256Dependency

AlexVelezLland others added 30 commits June 11, 2025 16:41
in favor of default templates
from .github repo
in favor of the default .github CONTRIBUTING.md
Improve clarity and remove dependencies
of tests on wrapper internal implementation
Remove custom issue templates, turn on issue header automation, reference new contributing guidelines
…n/babel-f525feed9f
Bump the babel group with 4 updates
…ema-4.24.0
Bump jsonschema from 4.23.0 to 4.24.0
…s-2.32.4
Bump requests from 2.32.3 to 2.32.4
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 5.2.0 to 5.2.2.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](webpack/webpack-dev-server@v5.2.0...v5.2.2)
---
updated-dependencies:
- dependency-name: webpack-dev-server
dependency-version: 5.2.2
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
AlexVelezLland others added 16 commits August 6, 2025 09:46
Confirm None handling for attribution fields.
Add thumbnail placeholder to recommendation card
…sdk-2.34.1
chore(deps): bump sentry-sdk from 2.34.0 to 2.34.1
Bumps [redis](https://github.com/redis/redis-py) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](redis/redis-py@v6.2.0...v6.3.0)
---
updated-dependencies:
- dependency-name: redis
dependency-version: 6.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
….3.0
chore(deps): bump redis from 6.2.0 to 6.3.0
…ls-7.5.0
chore(deps-dev): bump pip-tools from 7.4.1 to 7.5.0
…n/eslint-config-prettier-10.1.8
chore(deps-dev): bump eslint-config-prettier from 10.1.5 to 10.1.8
…n/node-vibrant-4.0.3
chore(deps): bump node-vibrant from 3.1.6 to 4.0.3
Ensure that file_format and preset match during file_upload requests.
Improve query that checks storage space before channel deploy
* Updated collection link and modal in channelSetList

@github-advanced-securitygithub-advanced-securityAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment on lines +9 to +14
uses: learningequality/.github/.github/workflows/contributor-issue-comment.yml@main
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}

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: {}

Copilot Autofix

AI about 1 year ago

To fix the problem, add a permissions block to the workflow file .github/workflows/call-contributor-issue-comment.yml. This block should be placed at the root level (above jobs:) to apply to all jobs in the workflow, unless a job overrides it. The permissions should be set to the minimum required for the workflow to function. Since the workflow is triggered by issue_comment and likely interacts with issues, a minimal starting point would be:

permissions:
issues: writecontents: read

This grants read access to repository contents and write access to issues, which is typically sufficient for workflows responding to issue comments. If the workflow requires additional permissions (e.g., for pull requests), those can be added as needed. The change should be made at the top of the file, after the name: and before the on: block.

Suggested changeset 1
.github/workflows/call-contributor-issue-comment.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/call-contributor-issue-comment.yml b/.github/workflows/call-contributor-issue-comment.yml
--- a/.github/workflows/call-contributor-issue-comment.yml
+++ b/.github/workflows/call-contributor-issue-comment.yml
@@ -1,5 +1,9 @@
name: Handle contributor comment on GitHub issue
+permissions:
+ issues: write
+ contents: read
+
on:
issue_comment:
types: [created]
EOF
@@ -1,5 +1,9 @@
name: Handle contributor comment on GitHub issue

permissions:
issues: write
contents: read

on:
issue_comment:
types: [created]
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines +9 to +13
name: Call shared workflow
uses: learningequality/.github/.github/workflows/manage-issue-header.yml@main
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}

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: {}

Copilot Autofix

AI about 1 year ago

To fix the problem, add a permissions block to the workflow or job definition to explicitly set the minimum required permissions for the GITHUB_TOKEN. Since this workflow only calls a reusable workflow and does not perform any direct actions, the safest minimal permissions are contents: read. This can be set at the workflow level (applies to all jobs) or at the job level (applies only to the specific job). The best practice is to set it at the workflow level unless a job requires different permissions. Edit the .github/workflows/call-manage-issue-header.yml file to add the following block after the name: line and before the on: block:

permissions:
contents: read

No additional imports, methods, or definitions are needed.


Suggested changeset 1
.github/workflows/call-manage-issue-header.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/call-manage-issue-header.yml b/.github/workflows/call-manage-issue-header.yml
--- a/.github/workflows/call-manage-issue-header.yml
+++ b/.github/workflows/call-manage-issue-header.yml
@@ -1,3 +1,5 @@
+permissions:
+ contents: read
name: Manage issue header
on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: Manage issue header

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines +9 to +12
uses: learningequality/.github/.github/workflows/community-contribution-label.yml@main
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}

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: {}

Copilot Autofix

AI about 1 year ago

To fix the problem, you should add a permissions block to the workflow file .github/workflows/community-contribution-labeling.yml. The block can be added at the root level (applies to all jobs) or at the job level (applies only to the specific job). Since this workflow only contains a single job that calls a reusable workflow, the best practice is to add the permissions block at the root level, immediately after the name and before the on key. The minimal starting point is to set all permissions to read unless the workflow requires write access to specific resources. For workflows that label issues, you typically need issues: write and possibly contents: read. Therefore, add:

permissions:
contents: readissues: write

immediately after the name line.

Suggested changeset 1
.github/workflows/community-contribution-labeling.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/community-contribution-labeling.yml b/.github/workflows/community-contribution-labeling.yml
--- a/.github/workflows/community-contribution-labeling.yml
+++ b/.github/workflows/community-contribution-labeling.yml
@@ -1,3 +1,6 @@
+permissions:
+ contents: read
+ issues: write
name: Community Contribution Label
on:
EOF
@@ -1,3 +1,6 @@
permissions:
contents: read
issues: write
name: Community Contribution Label

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines +17 to +28
name: Path match check
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths_ignore: '["**.po", "**.json"]'
linting:

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: {}

Copilot Autofix

AI about 1 year ago

To fix the problem, add a permissions block to the workflow file. The block should be placed at the top level (applies to all jobs) or at the job level (for each job that needs specific permissions). The minimal and safest starting point is permissions: {} (no permissions), but most workflows require at least contents: read to check out code. Since this workflow uses actions/checkout and does not appear to require write access, set permissions: contents: read at the top level, which will apply to all jobs unless overridden. This change should be made near the top of the file, after the name: and before on:.


Suggested changeset 1
.github/workflows/pre-commit.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/pre-commit.yml b/.github/workflows/pre-commit.yml
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -1,3 +1,5 @@
+permissions:
+ contents: read
name: Linting
on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: Linting

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines +29 to +52
name: All file linting
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Use pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- name: Install dependencies
run: |
pnpm install --frozen-lockfile
pnpm rebuild node-sass
- uses: pre-commit/action@v3.0.1
- name: Run pre-commit-ci-lite
uses: pre-commit-ci/lite-action@v1.1.0
if: always()

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 about 1 year ago

To fix the problem, add a permissions block to the workflow to explicitly set the minimum required permissions for the GITHUB_TOKEN. Since the workflow only performs linting and pre-commit checks, it likely only needs read access to repository contents. The best way to fix this is to add permissions: contents: read at the top level of the workflow file, just below the name field and before the on block. This will apply the least privilege principle to all jobs in the workflow, unless a job overrides it with its own permissions block.


Suggested changeset 1
.github/workflows/pre-commit.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/pre-commit.yml b/.github/workflows/pre-commit.yml
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -1,3 +1,5 @@
+permissions:
+ contents: read
name: Linting
on:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: Linting

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines +11 to +15
uses: learningequality/.github/.github/workflows/unassign-inactive-issues.yaml@main
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}

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: {}

Copilot Autofix

AI about 1 year ago

To fix the problem, add a permissions block to the workflow file. The best practice is to set the minimal permissions required for the workflow to function. Since the job is using a reusable workflow, and we do not know the exact permissions required by unassign-inactive-issues.yaml, the safest minimal starting point is to set permissions: read-all at the workflow level. This can be further restricted if the reusable workflow's documentation specifies more limited needs (e.g., only issues: write). The permissions block should be added at the top level of the workflow file, after the name and run-name fields and before the on field.


Suggested changeset 1
.github/workflows/unassign-inactive.yaml

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/unassign-inactive.yaml b/.github/workflows/unassign-inactive.yaml
--- a/.github/workflows/unassign-inactive.yaml
+++ b/.github/workflows/unassign-inactive.yaml
@@ -1,5 +1,8 @@
name: "Unassign Inactive Contributors"
run-name: Unassign Inactive Contributors
+permissions:
+ contents: read
+ issues: write
on:
schedule:
EOF
@@ -1,5 +1,8 @@
name: "Unassign Inactive Contributors"
run-name: Unassign Inactive Contributors
permissions:
contents: read
issues: write

on:
schedule:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment on lines +8 to +12
uses: learningequality/.github/.github/workflows/update-pr-spreadsheet.yml@main
secrets:
CONTRIBUTIONS_SPREADSHEET_ID: ${{ secrets.CONTRIBUTIONS_SPREADSHEET_ID }}
CONTRIBUTIONS_SHEET_NAME: ${{ secrets.CONTRIBUTIONS_SHEET_NAME }}
GH_UPLOADER_GCP_SA_CREDENTIALS: ${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}

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: {}

Copilot Autofix

AI about 1 year ago

To fix the problem, add a permissions block to the workflow or the specific job to explicitly set the minimal required permissions for the GITHUB_TOKEN. Since the job is calling a reusable workflow that likely needs to update a spreadsheet and possibly interact with pull requests, a safe minimal starting point is to grant contents: read and pull-requests: write permissions. This should be added at the job level (under call-update-spreadsheet:) or at the root of the workflow (applies to all jobs). The best practice is to add it at the job level for clarity and least privilege. No other changes are needed.


Suggested changeset 1
.github/workflows/update-pr-spreadsheet.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/update-pr-spreadsheet.yml b/.github/workflows/update-pr-spreadsheet.yml
--- a/.github/workflows/update-pr-spreadsheet.yml
+++ b/.github/workflows/update-pr-spreadsheet.yml
@@ -5,6 +5,9 @@
jobs:
call-update-spreadsheet:
+ permissions:
+ contents: read
+ pull-requests: write
uses: learningequality/.github/.github/workflows/update-pr-spreadsheet.yml@main
secrets:
CONTRIBUTIONS_SPREADSHEET_ID: ${{ secrets.CONTRIBUTIONS_SPREADSHEET_ID }}
EOF
@@ -5,6 +5,9 @@

jobs:
call-update-spreadsheet:
permissions:
contents: read
pull-requests: write
uses: learningequality/.github/.github/workflows/update-pr-spreadsheet.yml@main
secrets:
CONTRIBUTIONS_SPREADSHEET_ID: ${{ secrets.CONTRIBUTIONS_SPREADSHEET_ID }}
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Comment threadcontentcuration/contentcuration/management/commands/setup.py Dismissed
Comment threadcontentcuration/contentcuration/urls.py Fixed
Comment threadcontentcuration/contentcuration/utils/celery/tasks.py Dismissed
Comment threadcontentcuration/contentcuration/utils/files.py Fixed
Comment threadcontentcuration/contentcuration/views/base.py Dismissed
Comment threadcontentcuration/contentcuration/views/zip.py Fixed
Comment threadcontentcuration/kolibri_public/views_v1.py Fixed
Comment threadcontentcuration/kolibri_public/views_v1.py Fixed
Comment threadcontentcuration/kolibri_public/views_v1.py Fixed
Comment threadcontentcuration/kolibri_public/views_v1.py Fixed
Address user-supplied CodeQL issues
)
except KeyError as e:
return HttpResponseBadRequest(
"Required attribute missing from data | {}".format(str(e))

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

Copilot Autofix

AI about 1 year ago

To avoid revealing potentially sensitive internal information, the handler for KeyError in the api_create_channel_endpoint function should not return the string representation of the exception object as part of the HTTP error response. Instead, it should return a generic error message (e.g., "Required attribute missing from data"), optionally logging the actual exception server-side for debugging. This involves editing lines 224–227 to remove str(e) from the response message, and possibly adding a server-side logging call for the exception.

  • Change the return value of the except KeyError as e: block to a generic message: "Required attribute missing from data".
  • Optionally, log the error (using logging.exception or similar).
  • Do not include the missing key name or stringified exception in the HTTP response body.
Suggested changeset 1
contentcuration/contentcuration/views/internal.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/contentcuration/contentcuration/views/internal.py b/contentcuration/contentcuration/views/internal.py
--- a/contentcuration/contentcuration/views/internal.py
+++ b/contentcuration/contentcuration/views/internal.py
@@ -222,9 +222,8 @@
}
)
except KeyError as e:
- return HttpResponseBadRequest(
- "Required attribute missing from data | {}".format(str(e))
- )
+ logging.exception("Missing required attribute in channel create request.")
+ return HttpResponseBadRequest("Required attribute missing from data")
except Exception as e:
handle_server_error(e, request)
return HttpResponseServerError(content=str(e), reason=str(e))
EOF
@@ -222,9 +222,8 @@
}
)
exceptKeyErrorase:
returnHttpResponseBadRequest(
"Required attribute missing from data | {}".format(str(e))
)
logging.exception("Missing required attribute in channel create request.")
returnHttpResponseBadRequest("Required attribute missing from data")
exceptExceptionase:
handle_server_error(e, request)
returnHttpResponseServerError(content=str(e), reason=str(e))
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
return HttpResponseBadRequest("Required attribute missing from data: {}".format(data))
except KeyError as e:
return HttpResponseBadRequest(
"Required attribute missing from data | {}".format(str(e))

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

Copilot Autofix

AI about 1 year ago

To fix the problem, the function should return a generic error message to the client when a KeyError is caught, rather than interpolating the exception message which can leak information about internal variable names or input data structure. The actual error details (including the exception message) should be recorded in logs and/or sent to Sentry for developer diagnostics.

Detailed steps:

  • Replace the except KeyError as e: block such that it logs or reports the error (using the existing handle_server_error or report_exception methods, as appropriate).
  • The HTTP response should return a generic error message like "Required attribute missing from data" without any dynamic content (i.e., do not interpolate str(e) into the message).

Files/lines to change:

  • Only make changes inside contentcuration/contentcuration/views/internal.py within the api_commit_channel function and do not alter code that is not shown.
  • Add logging/reporting of the actual exception for admin/developer reference.

Suggested changeset 1
contentcuration/contentcuration/views/internal.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/contentcuration/contentcuration/views/internal.py b/contentcuration/contentcuration/views/internal.py
--- a/contentcuration/contentcuration/views/internal.py
+++ b/contentcuration/contentcuration/views/internal.py
@@ -295,8 +295,9 @@
except (Channel.DoesNotExist, PermissionDenied):
return HttpResponseNotFound("No channel matching: {}".format(channel_id))
except KeyError as e:
+ handle_server_error(e, request)
return HttpResponseBadRequest(
- "Required attribute missing from data | {}".format(str(e))
+ "Required attribute missing from data"
)
except Exception as e:
handle_server_error(e, request)
EOF
@@ -295,8 +295,9 @@
except (Channel.DoesNotExist, PermissionDenied):
returnHttpResponseNotFound("No channel matching: {}".format(channel_id))
exceptKeyErrorase:
handle_server_error(e, request)
returnHttpResponseBadRequest(
"Required attribute missing from data | {}".format(str(e))
"Required attribute missing from data"
)
exceptExceptionase:
handle_server_error(e, request)
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
return HttpResponseBadRequest("Required attribute missing from data: {}".format(data))
except KeyError as e:
return HttpResponseBadRequest(
"Required attribute missing from data | {}".format(str(e))

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

Copilot Autofix

AI about 1 year ago

The best fix is to replace the HttpResponseBadRequest in the except KeyError as e: block so that it does not return the exception detail (str(e)) to the user. Instead, it should return a generic "Required attribute missing from request data" message. The detail can be logged server-side using the Python logging module or sent to Sentry if available.

Specifically:

  • In api_add_nodes_to_tree (lines ~354-357), replace the return statement so the user response does not include str(e).
  • Optionally, add a call to logging.error() (or use the existing Sentry report facility as imported) to capture the original exception detail for diagnostics.
  • No additional dependencies are needed, as logging is already imported and Sentry reporting appears available.
  • No changes outside this block are required.

Suggested changeset 1
contentcuration/contentcuration/views/internal.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/contentcuration/contentcuration/views/internal.py b/contentcuration/contentcuration/views/internal.py
--- a/contentcuration/contentcuration/views/internal.py
+++ b/contentcuration/contentcuration/views/internal.py
@@ -352,9 +352,8 @@
except ValidationError as e:
return HttpResponseBadRequest(content=str(e))
except KeyError as e:
- return HttpResponseBadRequest(
- "Required attribute missing from data | {}".format(str(e))
- )
+ logging.error("Required attribute missing in api_add_nodes_to_tree: %s", str(e))
+ return HttpResponseBadRequest("Required attribute missing from request data")
except NodeValidationError as e:
return HttpResponseBadRequest(str(e))
except Exception as e:
EOF
@@ -352,9 +352,8 @@
exceptValidationErrorase:
returnHttpResponseBadRequest(content=str(e))
exceptKeyErrorase:
returnHttpResponseBadRequest(
"Required attribute missing from data | {}".format(str(e))
)
logging.error("Required attribute missing in api_add_nodes_to_tree: %s", str(e))
returnHttpResponseBadRequest("Required attribute missing from request data")
exceptNodeValidationErrorase:
returnHttpResponseBadRequest(str(e))
exceptExceptionase:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
rtibblesand others added 2 commits August 21, 2025 15:33
…are KA only markdown elements.
Ensure relative path is used during QTI item generation.
Fix image export in QTI exercise publishing

@rtibblesrtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's hotfix this!

@bjester
bjester merged commit 71eef1b into hotfixesAug 22, 2025
33 of 34 checks passed
@bjesterbjester mentioned this pull request Aug 22, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

17 participants

@bjester@rtibbles@github-advanced-security@AlexVelezLl@MisRob@yeshwanth235@habibayman@akolson@taoerman@LianaHarris360@Jakoma02@radinamatic@vtushar06@nucleogenesis@marcellamaki@AadarshM07@RONAK-AI647