-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
fix: prevent use of local ips on webhooks #20487
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
Conversation
|
Let me know your opinion on this approach before I commit on some UI changes and api tests |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll run some tests tomorrow but if nothing is on the internal IP+port it may not have a status code
|
@derrickmehaffy I believe the fetch api returns a 500 by default if the port is not found, or at least guarantees the status code is present on the response. |
|
After a discussion with Alex , we decided to just prevent local ips to be used on webhook settings. |
|
I am now working on some api tests, but logic should be ready (thank you Remi! 🚀 ) |
packages/core/admin/admin/src/pages/Settings/pages/Webhooks/EditPage.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ✅
| .test( | ||
| 'is-public-url', | ||
| "Url is not supported because it isn't reachable over the public internet", | ||
| async (url) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we supposed to prevent this only in production env ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, yes! I added the if case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I think we might want !== production in case we are doing tests for ex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
|
Hi guys! I have a problem with Strapi 4.25.2 and above, seems to be due to this change. |
|
@ekozliaev would it be possible for you to set a host alias in the machine you have your strapi app deployed? A "solution" from our side would be to allow a flag to be set, but I would prefer avoiding so. This behaviour is disabled if running the app on development (NODE_ENV="development" or running yarn dev , but allowing local ips on production environments can lead to security issues. |
|
@Marc-Roig Sorry, I don't really understand what you mean by host alias. Do you mean "etc/hosts"? We run all this in k8s. Yes, I know about NODE_ENV as a workaround, for test environments it might still work somehow. How about a specific configuration of allowed domains for the URL field? |
|
Just to clarify. We have Strapi deployed inside the company network for all environments including production. The url that we trigger via webhook restarts the build in the container in which our frontend is deployed (something like a preview of changes in the CMS). This frontend is also deployed inside the company network. |
* cron type fix * Fix typo of query key from 'providers' to 'get-providers' * Closing #19644 fix filters type * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * fix patreon oauth 400 error from lack of user-agent header * test: backport cli tests (#20433) * fix(chore): increase specificity of the Lightning icon color (#20467) * test: temporarily disable broken edit ctb tests on CI (#20481) * feat(cli): cloud cli commands (v4) (#20119) * feat(cli): add cloud commands Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com> Co-authored-by: nathan-pichon <nathan.pichon@strapi.io> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> * v4.25.0 (#20500) * NPS: Update frequency of the NPS (#20492) * enhancement(admin): change postFirstDismissal and display delays * enhancement(admin): change the display delay * fix: prevent use of local ips on webhooks (#20487) * chore: mask error on webhook manual trigger * feat: prevent using local ips * feat: display webhook edit error * chore: pr suggestion * chore: api tests * chore: allow local ips on development * chore: only run check on production * feat: include internationalized urls * fix: prettier * Add: Strapi deploy command to README files * v4.25.1 * Update @aws-sdk/client-s3 package * feat(cli): add browser logout step (#20502) * feat(cli): add browser log out step * handle error whiile fetching the config * Update LICENSE packing for packages for v4 (#20576) * feat(create-strapi-app): remove the cloud project creation part (#20561) * feat(create-strapi-app): remove the cloud project creation part * fix(create-strapi-app): adding new parameter to cloud service instantiation * Update Yarn to 4.3.1 Signed-off-by: Sora Morimoto <sora@morimoto.io> * feat(cli): trigger login sequence when token is missing or invalid (#20572) * feat(cli): launch login when auth fails * fix(cli): abstract create project fn * fix(cli): guidelines * fix(cli): rebase --------- Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> * fix clone entity, #20509 (#20531) * chore: bump glob from 7.2.0 to 9.0.0 * chore: bump glob to v10.4.2 in core/strapi * update yarn.lock * removed redundant packages/core/strapi/src/load/glob.ts file * v4.25.2 to main (#20676) * Fix typo of query key from 'providers' to 'get-providers' * Closing #19644 fix filters type * fix patreon oauth 400 error from lack of user-agent header * Add: Strapi deploy command to README files * Update @aws-sdk/client-s3 package * feat(cli): add browser logout step (#20502) * feat(cli): add browser log out step * handle error whiile fetching the config * Update LICENSE packing for packages for v4 (#20576) * feat(create-strapi-app): remove the cloud project creation part (#20561) * feat(create-strapi-app): remove the cloud project creation part * fix(create-strapi-app): adding new parameter to cloud service instantiation * Update Yarn to 4.3.1 Signed-off-by: Sora Morimoto <sora@morimoto.io> * feat(cli): trigger login sequence when token is missing or invalid (#20572) * feat(cli): launch login when auth fails * fix(cli): abstract create project fn * fix(cli): guidelines * fix(cli): rebase --------- Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> * fix: support string array * fix clone entity, #20509 (#20531) * v4.25.2 --------- Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: smoothdvd <madfxgao@gmail.com> Co-authored-by: Micah Riggan <micahriggan@gmail.com> Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com> Co-authored-by: Maxime Castres <mcastres@student.42.fr> Co-authored-by: Alex Supkay <asupkay1124@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Kirill Verevkin <kira795@yandex.ru> * v4.25.2 (#20675) * fix: support string array * v4.25.2 --------- Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * feat(cli): use project name from package json by default (#20479) * chore: change cloud message in homepage (#20685) * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: updating contributing guide workflow * chore: release v4.25.3 (#20722) * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 to develop (#20832) * 4.25.4 to main (#20833) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * Chore: Removing some people from the issue auto-assignment Removing Simen and Nick from the array of people issues will be auto-assigned to * fix(cloud-cli): avoid blocking event loop in deploy command (#20850) * chore(cloud-cli): update error handling for config and logs at the ends of function execution * fix(cloud-cli): clear timeout before returning - free the event loop from waiting * feat(cli): add project link command to cloud cli (#20714) * feat(cli): add link command * 4.25.5 to main (#20873) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: updating contributing guide workflow * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 to develop (#20832) * Chore: Removing some people from the issue auto-assignment Removing Simen and Nick from the array of people issues will be auto-assigned to * fix(cloud-cli): avoid blocking event loop in deploy command (#20850) * chore(cloud-cli): update error handling for config and logs at the ends of function execution * fix(cloud-cli): clear timeout before returning - free the event loop from waiting * feat(cli): add project link command to cloud cli (#20714) * feat(cli): add link command * v4.25.5 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: José Luis <alagunasalahaddin@live.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: DMehaffy <derrickmehaffy@gmail.com> * v4.25.5 to develop (#20872) * 4.25.4 to main (#20833) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * v4.25.5 --------- Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * fix custom email provider test issue #19122 (#19123) * fix custom email provider test issue #19122 * chore(email): prettier clean up --------- Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * Changed Discord username to fit change Discord made. * v4.25.6 * fix(cli): Update 'project not found' error message in deploy command (#20923) * chore: aggregate test result to add a single required status check and make it dynamic * shard ee tests+ fix broken platform (#20914) * v4.25.7 * RBAC Action Aliases - v4 (#20954) * test(cli): add list command tests (#20949) * feat(cloud-cli): preselect node-version based on local node-version (#20959) * [Fix] Validate cloning as entity creation so field validations aren't skipped e.g. unique constraints (#20963) * flatten CI workflow tests (#20969) * v4.25.8 release to develop (#21011) * Removing workflows the support team doesn't need anymore * chore: getstarted schema sync between v4-v5 (#21047) * Chore(CLI): Add validation to prevent deployment of suspended projects (#20976) * chore(cli): check project suspension * Prettier fix * chore(deps): update axios to 1.7.4 (#21014) * fix(cli): Update endpoint path for listLinkProjects (#21052) * chore: update lint-staged to 15.2.9 (#21075) * v4.25.9 * fix: issue 21079 * fix: rich text selection & deletion issues * fix: build * fix: type * fix: skip failing cli tests * chore: fix jest options in ci --------- Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: smoothdvd <madfxgao@gmail.com> Co-authored-by: Micah Riggan <micahriggan@gmail.com> Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Simone <startae14@gmail.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> Co-authored-by: Maxime Castres <mcastres@student.42.fr> Co-authored-by: Convly <jean-sebastien.herbaux@epitech.eu> Co-authored-by: Alex Supkay <asupkay1124@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Kirill Verevkin <kira795@yandex.ru> Co-authored-by: chrismuiruriz <chrismuiruri007@gmail.com> Co-authored-by: José Luis <alagunasalahaddin@live.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Rémi de Juvigny <remi.dejuvigny@strapi.io> Co-authored-by: DMehaffy <derrickmehaffy@gmail.com> Co-authored-by: ahallaha <104538552+ahallaha@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: mallowsc <mallowsc@outlook.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: mallowsc <96073136+mallowsc@users.noreply.github.com> Co-authored-by: Olli Hiekkaranta <Ohiekkar@users.noreply.github.com>
* cron type fix * Fix typo of query key from 'providers' to 'get-providers' * Closing #19644 fix filters type * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * fix patreon oauth 400 error from lack of user-agent header * test: backport cli tests (#20433) * fix(chore): increase specificity of the Lightning icon color (#20467) * test: temporarily disable broken edit ctb tests on CI (#20481) * feat(cli): cloud cli commands (v4) (#20119) * feat(cli): add cloud commands Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com> Co-authored-by: nathan-pichon <nathan.pichon@strapi.io> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> * v4.25.0 (#20500) * NPS: Update frequency of the NPS (#20492) * enhancement(admin): change postFirstDismissal and display delays * enhancement(admin): change the display delay * fix: prevent use of local ips on webhooks (#20487) * chore: mask error on webhook manual trigger * feat: prevent using local ips * feat: display webhook edit error * chore: pr suggestion * chore: api tests * chore: allow local ips on development * chore: only run check on production * feat: include internationalized urls * fix: prettier * Add: Strapi deploy command to README files * v4.25.1 * Update @aws-sdk/client-s3 package * feat(cli): add browser logout step (#20502) * feat(cli): add browser log out step * handle error whiile fetching the config * Update LICENSE packing for packages for v4 (#20576) * feat(create-strapi-app): remove the cloud project creation part (#20561) * feat(create-strapi-app): remove the cloud project creation part * fix(create-strapi-app): adding new parameter to cloud service instantiation * Update Yarn to 4.3.1 Signed-off-by: Sora Morimoto <sora@morimoto.io> * feat(cli): trigger login sequence when token is missing or invalid (#20572) * feat(cli): launch login when auth fails * fix(cli): abstract create project fn * fix(cli): guidelines * fix(cli): rebase --------- Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> * fix clone entity, #20509 (#20531) * chore: bump glob from 7.2.0 to 9.0.0 * chore: bump glob to v10.4.2 in core/strapi * update yarn.lock * removed redundant packages/core/strapi/src/load/glob.ts file * v4.25.2 to main (#20676) * Fix typo of query key from 'providers' to 'get-providers' * Closing #19644 fix filters type * fix patreon oauth 400 error from lack of user-agent header * Add: Strapi deploy command to README files * Update @aws-sdk/client-s3 package * feat(cli): add browser logout step (#20502) * feat(cli): add browser log out step * handle error whiile fetching the config * Update LICENSE packing for packages for v4 (#20576) * feat(create-strapi-app): remove the cloud project creation part (#20561) * feat(create-strapi-app): remove the cloud project creation part * fix(create-strapi-app): adding new parameter to cloud service instantiation * Update Yarn to 4.3.1 Signed-off-by: Sora Morimoto <sora@morimoto.io> * feat(cli): trigger login sequence when token is missing or invalid (#20572) * feat(cli): launch login when auth fails * fix(cli): abstract create project fn * fix(cli): guidelines * fix(cli): rebase --------- Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> * fix: support string array * fix clone entity, #20509 (#20531) * v4.25.2 --------- Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: smoothdvd <madfxgao@gmail.com> Co-authored-by: Micah Riggan <micahriggan@gmail.com> Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com> Co-authored-by: Maxime Castres <mcastres@student.42.fr> Co-authored-by: Alex Supkay <asupkay1124@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Kirill Verevkin <kira795@yandex.ru> * v4.25.2 (#20675) * fix: support string array * v4.25.2 --------- Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * feat(cli): use project name from package json by default (#20479) * chore: change cloud message in homepage (#20685) * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: updating contributing guide workflow * chore: release v4.25.3 (#20722) * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 to develop (#20832) * 4.25.4 to main (#20833) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * Chore: Removing some people from the issue auto-assignment Removing Simen and Nick from the array of people issues will be auto-assigned to * fix(cloud-cli): avoid blocking event loop in deploy command (#20850) * chore(cloud-cli): update error handling for config and logs at the ends of function execution * fix(cloud-cli): clear timeout before returning - free the event loop from waiting * feat(cli): add project link command to cloud cli (#20714) * feat(cli): add link command * 4.25.5 to main (#20873) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: updating contributing guide workflow * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 to develop (#20832) * Chore: Removing some people from the issue auto-assignment Removing Simen and Nick from the array of people issues will be auto-assigned to * fix(cloud-cli): avoid blocking event loop in deploy command (#20850) * chore(cloud-cli): update error handling for config and logs at the ends of function execution * fix(cloud-cli): clear timeout before returning - free the event loop from waiting * feat(cli): add project link command to cloud cli (#20714) * feat(cli): add link command * v4.25.5 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: José Luis <alagunasalahaddin@live.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: DMehaffy <derrickmehaffy@gmail.com> * v4.25.5 to develop (#20872) * 4.25.4 to main (#20833) * cron type fix * node-scadule updated + types updated * Fix formating errors * fix formatting * update lock file * chore(cloud-cli): migrate to fs-extra (#20695) * feat(cloud-cli): migrate compress-files.ts to fs-extra * feat(cloud-cli): migrate pkg.ts to fs-extra * fix(cloud-cli): update using promises in recursive function * feat(cli): Add projects list command (#20694) * feat(cli): projects list command * fix: invalid path separator (#20740) * fix: invalid path separator * fix: prettier * v4.25.4 --------- Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * v4.25.5 --------- Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> * fix custom email provider test issue #19122 (#19123) * fix custom email provider test issue #19122 * chore(email): prettier clean up --------- Co-authored-by: Jamie Howard <jamie.howard@strapi.io> * Changed Discord username to fit change Discord made. * v4.25.6 * fix(cli): Update 'project not found' error message in deploy command (#20923) * chore: aggregate test result to add a single required status check and make it dynamic * shard ee tests+ fix broken platform (#20914) * v4.25.7 * RBAC Action Aliases - v4 (#20954) * test(cli): add list command tests (#20949) * feat(cloud-cli): preselect node-version based on local node-version (#20959) * [Fix] Validate cloning as entity creation so field validations aren't skipped e.g. unique constraints (#20963) * flatten CI workflow tests (#20969) * v4.25.8 release to develop (#21011) * Removing workflows the support team doesn't need anymore * chore: getstarted schema sync between v4-v5 (#21047) * Chore(CLI): Add validation to prevent deployment of suspended projects (#20976) * chore(cli): check project suspension * Prettier fix * chore(deps): update axios to 1.7.4 (#21014) * fix(cli): Update endpoint path for listLinkProjects (#21052) * chore: update lint-staged to 15.2.9 (#21075) * v4.25.9 * fix: issue 21079 * fix: rich text selection & deletion issues * fix(content-releases): await release status update after createMany actions * fix(content-releases): add test case for createMany * Fix: DTS parallelism issue on data consumption for assets (#19676) Co-authored-by: Convly <jean-sebastien.herbaux@epitech.eu> Co-authored-by: meeehdi <mehdi.mhiri@gmail.com> * v4.25.10 (#21142) * fix(content-releases): fix action test for v5 --------- Signed-off-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com> Co-authored-by: smoothdvd <madfxgao@gmail.com> Co-authored-by: Micah Riggan <micahriggan@gmail.com> Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com> Co-authored-by: Ben Irvin <ben.irvin@strapi.io> Co-authored-by: Simone <startae14@gmail.com> Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io> Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com> Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com> Co-authored-by: Maxime Castres <mcastres@student.42.fr> Co-authored-by: Convly <jean-sebastien.herbaux@epitech.eu> Co-authored-by: Alex Supkay <asupkay1124@gmail.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com> Co-authored-by: Sora Morimoto <sora@morimoto.io> Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com> Co-authored-by: Kirill Verevkin <kira795@yandex.ru> Co-authored-by: chrismuiruriz <chrismuiruri007@gmail.com> Co-authored-by: José Luis <alagunasalahaddin@live.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Rémi de Juvigny <remi.dejuvigny@strapi.io> Co-authored-by: DMehaffy <derrickmehaffy@gmail.com> Co-authored-by: ahallaha <104538552+ahallaha@users.noreply.github.com> Co-authored-by: Jamie Howard <jamie.howard@strapi.io> Co-authored-by: mallowsc <mallowsc@outlook.com> Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com> Co-authored-by: mallowsc <96073136+mallowsc@users.noreply.github.com> Co-authored-by: Olli Hiekkaranta <Ohiekkar@users.noreply.github.com> Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io> Co-authored-by: Chris <11177048+chrisli-03@users.noreply.github.com> Co-authored-by: meeehdi <mehdi.mhiri@gmail.com>
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: |
|
Hi all, Why would you do this kind of validation? It doesn't really make sense in my eyes. We are using Strapi to communicate with the CI / CD software using
@Marc-Roig Why is that? I don't want to publish the CI / CD software's endpoints to the public internet, it doesn't make any sense. Update: |
|
@MrMarci666 This was done for security reasons only. you can read the overall concept of the attack vector this leaves open if you allow anyone to put localhost domains here https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html Registering a webhook programmatically avoids the Human factor and allows you to be as safe/unsafe as you decide to. It's controlled by you and you can set the url you want like that. that's why we only validate UI user inputs |
|
@alexandrebodin Thank you for explaining the decision! 😄 We will register a webhook programmatically then. |
|
@alexandrebodin For security reasons? I had to create a new public url just to get around this. No other reason. I now have less security by exposing more of my private hosted network. |
|
@adconk Can you share your usecase ? Here are a few options depending on whether you really want to expose internal access or not
|
|
Hi, we run Strapi as one container in an AWS ECS cluster. It's a backend to
our web application and Unity3d application that runs on an AR headset. We
use it for authentication, data schema API, and the webhooks trigger other
python flask services related to medical image segmentation and machine
learning also in our ECS cluster. We store de-identified medical images
that were segmented and converted to 3d mesh files that we use with
Neurosurgeons with our Augmented Reality headsets and client application
that talks to our backend. I imagine you don't see too many uses like this,
and we've been on the fence about whether to keep using Strapi. We do not
store any PHI data in Strapi.
…On Wed, Oct 16, 2024 at 7:55 AM Alexandre BODIN ***@***.***> wrote:
@adconk <https://github.com/adconk> Can you share your usecase ?
Here are a few options depending on whether you really want to expose
internal access or not
-
As suggested above you can programmatically register the webhook if
you really want to use an internal ip as it's unsafe when users can do it
themselves from the UI.
-
You can configure private hostnames to do routing inside local private
networks. you can then make sure request will go to a specific ip that you
can protect correctly.
-
You can programmaticaly listen to events to do whatever you want
—
Reply to this email directly, view it on GitHub
<#20487 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOLLQNFFKTV5VZSYBYBXPLZ3ZH3FAVCNFSM6AAAAABJCSCA2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJWGU4TQNZVGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hooo indeed that's pretty uncommon but very interesting.
Edit: this solution will not work correctly. Using programmaticaly registered webhooks will be the only way to set unsafe URLs in a safe way |
|
Seem create the private domain name is not the solution because we are using isLocalhostIp from package is-localhost-ip (
|
|
@lhsanghcmus very good point.that's not a valid workaround actually you are totally right and As I said earlier it makes sense as it would still be unsafe 👍 So except from programmaticaly registring to avoid the attack vector or using a webhook delivery service (but opens your service to the internet) there are no other obvious workaround that would be considered safe in production. |
|
Hello @alexandrebodin I tracked down this PR to figure out why our Strapi admins (non-coders) were unable to add new local webhooks. I’m concerned that this change is a breaking change for many users and it is not just a bugfix. Particularly for those deploying Strapi locally in environments like Kubernetes. This restriction now prevents Strapi from contacting local services via webhooks, which is crucial like for us, as we use Strapi webhooks to notify Next.js when content is updated. Now we have to "hack" our setup by directly changing the url in database to bypass the validation. While I have read your previous responses and understand that there can be security risks, it would be nice to have an option (for example, in Strapi security policies) to bypass this restriction. |
|
It's a fair point @skifahrer, sadly it was the only way to fix the critical security issue and all appplication doing this (even if intentionnaly) are considered unsafe. I'm on the fence about adding an option to allow sth that is considered a cirtical security issue even if the users wants it. Right now I think it would be unresponsible from us to allow it 😞. I think we could allow a "custom validation" function instead so we delegate the validation responsibility instead of allowing sth unsafe. it would be safer by default and would require a bit more of intentional work to skip this validation. In the meantime, here is a example to do it programmaticaly to avoid doing messy things. const webhook = await strapi.db.query('strapi::webhook').findOne({
where: {
name: 'some_internal_webhook',
},
});
if (!webhook) {
strapi.get('webhookStore').createWebhook({
name: 'some_internal_webhook',
url: 'http://localhost:1337/webhook',
events: ['entry.create', 'entry.update'],
headers: {},
enabled: true,
});
} |
|
@alexandrebodin the solution you suggested not works, I got the error "strapi::webhook" not found. I really need this: I have the target website over VPN for security reason. Now as workaround we need to disable the entire cache of the frontend because we can't do it manually triggering the webhook, pretty bad and I'm not the only one as I can see. *** UPDATE *** I published the URL over the public Web but unfortunally I can still see the error. |
|
@axelpezzo What version of strapi are you using ? this code snippet should go into your boostrap function in your strapi app. We validated it's working as expected in v5 latested versions. |
|
I'm using the 4.25 and I got this error runnig your script inside the bootstrap:
|
in v4 it would be |
This is really funny because in this case the error message is also not precise. |
|
I'm hitting this problem, too. In my use case, I have Strapi in a Docker container, and a web server (Astro) running in another container. I'm trying to use the webhook functionality to have Strapi kick off an Astro build, by calling to the Docker service name. Ok, so I have to use a public URL. Well, I changed the webhook to use the public URL (which will then route the webhook call to the NGINX reverse proxy which is also running as a Docker container) but I still get the error about the URL not being reachable on the public Internet. Digging through the code of this pull request, I can see why, in const isLocalUrl = await isLocalhostIp(parsedUrl.hostname);The So, the test is flawed, as it doesn't check to see if the URL is also publicly routable. That aside, the code informs a simple workaround, on lines 35-37, just above the culprit line 41: if (process.env.NODE_ENV !== 'production') {
return true;
}The workaround is to simply set |
|
@cwilso03 I understand the frustration, but I really recommend not running Strapi with NODE_ENV !== 'production' just to get around this validation. That environment flag controls much more than just a simple check — it affects error handling, caching, logging, and general runtime behavior across the entire Node.js ecosystem. Running production systems in non-prod mode introduces security and stability risks that are much harder to detect later on. And to the @strapi team: this is a clear example of what happens when a security fix is implemented too rigidly and without flexibility. Many of us are using Strapi in isolated environments — Docker networks, Kubernetes clusters, private VPCs, etc. Blocking internal URLs from the UI with no config option or escape route breaks essential workflows for CI/CD, build processes, preview deployments, and more. I understand the SSRF concerns — they’re valid. But the solution shouldn’t force teams to compromise the architecture of their infrastructure. In fact, workarounds like editing the database directly, exposing internal services publicly, or disabling production mode create more serious vulnerabilities than the one you were trying to prevent. If the goal is secure defaults, that’s great — but please give us a way to override them responsibly. A configuration setting, environment variable, or custom validation hook would solve this cleanly without encouraging unsafe practices. At the end of the day, we need a balance between security and usability. This change, as it stands now, doesn’t provide that. |
|
@MrMarci666 I agree; it's a sub-optimal solution. The only way an attacker could leverage this for SSRF is if they could modify the webhook URL. Unless I'm missing something obvious, the only way they could do that is if they had already hacked an admin account, at which point the site admins have bigger problems. If the concern is a new webhook could be created via ReST (which, apparently, this PR doesn't even address), then just provide an admin option to disable that API endpoint. Problem solved. |
|
I concur with @MrMarci666 and @cwilso03. If I could go back and make my services that are triggered by webhook non-public again, I would in a second. They shouldn’t be public but I had to make that change as a workaround. I found this change very disruptive and detrimental to my tech stack. Not just usability, but overall security. |
Fix for
GHSA-v8wj-f5c7-pvxfPrevents local ips to be used on webhooks.
User will see the following error if trying to use one:
Notes
V5 migration should be straightforward on the BE side, but we will need to check on the FE side if errors are being displayed on the Webhooks settings page