Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.47k stars 1.55k forks source link

[BUDI-6604] CSP blocking custom components use of Google Recaptcha #9679

Open keith-ellis-sillek opened 1 year ago

keith-ellis-sillek commented 1 year ago

Checklist

Hosting

Describe the bug I created a custom component for Budibase here - https://github.com/keith-ellis-sillek/budibase-recaptura-v2 It works beautifully in development on localhost. However, when I deploy, it fails CSP for https://www.google.com/recaptcha/api.js I understand that you don't want to add just anyone's libraries, but could you add google's?

To Reproduce Steps to reproduce the behavior:

  1. Install a local hosted version of Budi
  2. Add the plugin listed above
  3. Create a test app and add the recaptcha component
  4. The component renders in both the builder and preview
  5. Do steps 2-4 for a deployed version of Budi
  6. The component doesn't render and in the brower's development tools, you get a csp:blocked error

Expected behavior Like it to render?!

Screenshots On a plane, but will try to post when I land

App Export If possible - please attach an export of your budibase application for debugging/reproduction purposes.

Desktop (please complete the following information):

Additional context

BUDI-6604

keith-ellis-sillek commented 1 year ago
Screenshot 2023-02-13 at 6 29 25 PM Screenshot 2023-02-13 at 6 30 04 PM
giacomouberti commented 1 year ago

I have the same issue, I wrote a custom component to embed a script in order to be able to add a comment box inside a side panel but the script gets blocked, custom components should be able to allow for external scripts to be loaded or at least should be possible to extend the CSP directive

Refused to load the script 'https://cdn.commento.io/js/commento.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.budibase.net https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity.

melohagan commented 10 months ago

Hey @keith-ellis-sillek

I was going to test this one, however you do not have a release tied to the plugin repo. You'll need to add the release.yml, update the version number in the package.json, and then push up those changes.

E.g. https://github.com/melohagan/budibase-datasource-appwrite-attributes-indexes/tree/main/.github/workflows

keith-ellis-sillek commented 10 months ago

I never got a response, so I didn't post it to the plugins directory. For this to work, the Nginx server has to be configured to allow the Google Captcha code to come through. I could do it on my private instance, but unless the change is made in the Cloud deployment, it won't work for those users. Any standalone instances would also have to change their nginx instance, which just seemed too much to ask a Budibase nocode developer to do.

Here is my code if you want to take a look.

https://github.com/keith-ellis-sillek/budibase-recaptura-v2

Keith Ellis @.*** 410-903-4027

On Wed, Dec 20, 2023 at 11:41 AM melohagan @.***> wrote:

Hey @keith-ellis-sillek https://github.com/keith-ellis-sillek

I was going to test this one, however you do not have a release tied to the plugin repo. You'll need to add the release.yml, update the version number in the package.json, and then push up those changes.

E.g. https://github.com/melohagan/budibase-datasource-appwrite-attributes-indexes/tree/main/.github/workflows

— Reply to this email directly, view it on GitHub https://github.com/Budibase/budibase/issues/9679#issuecomment-1864799601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKDKUUJ6NATMKSORWT3KXTYKMINJAVCNFSM6AAAAAAU24B3R6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUG44TSNRQGE . You are receiving this because you were mentioned.Message ID: @.***>

keith-ellis-sillek commented 10 months ago

It does work on my instance as expected.

Keith Ellis @.*** 410-903-4027

On Wed, Dec 20, 2023 at 11:41 AM melohagan @.***> wrote:

Hey @keith-ellis-sillek https://github.com/keith-ellis-sillek

I was going to test this one, however you do not have a release tied to the plugin repo. You'll need to add the release.yml, update the version number in the package.json, and then push up those changes.

E.g. https://github.com/melohagan/budibase-datasource-appwrite-attributes-indexes/tree/main/.github/workflows

— Reply to this email directly, view it on GitHub https://github.com/Budibase/budibase/issues/9679#issuecomment-1864799601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKDKUUJ6NATMKSORWT3KXTYKMINJAVCNFSM6AAAAAAU24B3R6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUG44TSNRQGE . You are receiving this because you were mentioned.Message ID: @.***>