Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CSP issue by removing unsafe-eval usage #7190

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

benglewis
Copy link

@benglewis benglewis commented Mar 9, 2025

Fixes #7189

Replace the Function constructor in the getProperty function with a safer implementation.

  • Use a loop to traverse the object properties based on the provided path.
  • Remove the usage of Function constructor to avoid requiring 'unsafe-eval' in the Content Security Policy.
  • Return undefined if any property in the path is not found.

For more details, open the Copilot Workspace session.

Fixes HumanSignal#7189

Replace the `Function` constructor in the `getProperty` function with a safer implementation.

* Use a loop to traverse the object properties based on the provided path.
* Remove the usage of `Function` constructor to avoid requiring 'unsafe-eval' in the Content Security Policy.
* Return `undefined` if any property in the path is not found.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/HumanSignal/label-studio/issues/7189?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

netlify bot commented Mar 9, 2025

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2e15e3f

Copy link

netlify bot commented Mar 9, 2025

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2e15e3f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant