Skip to content

fix: CSP issue by removing unsafe-eval usage #7190

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

Open
wants to merge 2 commits 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 0eb7951

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 0eb7951

@benglewis
Copy link
Author

@TylerConlee @bmartel Is there any timeline for considering and merging this PR? 🙏

@benglewis benglewis changed the title Fix CSP issue by removing unsafe-eval usage fix: CSP issue by removing unsafe-eval usage Apr 15, 2025
@benglewis benglewis changed the title fix: CSP issue by removing unsafe-eval usage fix: CSP issue by removing unsafe-eval usage Apr 15, 2025
@bmartel
Copy link
Contributor

bmartel commented Apr 15, 2025

/jira create optic

Workflow run
Jira issue TRIAG-1318 is created

Copy link

netlify bot commented Apr 15, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 0eb7951
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-storybook/deploys/67fe8467e53cf900081de7c5
😎 Deploy Preview https://deploy-preview-7190--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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