Webhook 페이로드 URL이 내부 IP 기반 값을 허용하지 않음

Hi,

I have recently upgraded my discouse instance to Discourse/2.9.0.beta14 latest version from Discourse/2.9.0.beta3.
The discourse webhook event has stopped working now.

This is the configuration
payload URL: http://server-name:port/rest : This is the internal rest api service that we have defined.

When I try to save this value, it gives the following error:
“An error occurred: Payload URL cannot be used because it resolves to a blocked or internal IP”

The same value for payload URL: http://server-name:port/rest used to work fine in the
Discourse/2.9.0.beta3 discourse version.
Is there something that has been updated in the latest version of discourse, or is this a bug?

Please could you let me know. Thanking in advance.

This doesn’t sound right. The payload URL for webhooks may indeed be an internal resource if Discourse is self hosted. Not sure why you would want to stop being able to configure URLS or addresses that resolve internally for processing web hooks. There has been a change it seems to prevent invalid/bad website URLs on user profiles. Has that change crept into the validation for the webhook payload URL ?

Because it can also be a security issue where a Discourse admin could use webhooks to discover or attack internal resources on a network which is not theirs?

1개의 좋아요

Yeah, moved this to Contribute > Feature, this can be used to fish information about an internal network. There are some knobs to tune the behavior on a specific instance.

1개의 좋아요

Our self-hosted instance is affected by this, as well. We would like to host the service that receives the webhook only on the internal docker network; there’s no need for it to be reachable from outside.

Is there a way to allow internal webhooks?

If I understand the issue correctly, internal webhooks are not allowed such that a discourse admin, who is not entitled as a server admin, may not spy on network internals. This is not an issue on our self-hosted instance, though; our discourse admins would know about our internal structure anyway.

I would suggest a setting in the app.yml config to allow internal webooks, or to provide a whitelist of internal domains/IPs. This way, the server admin (not the discourse admin) remains in control of who may use webhooks for the internal network.

I found a setting that allows to unblock specific internal hosts and is respected by the SSRF Protection mechanism that is causing the WebHooks to be blocked in the first place:

Use the setting allowed_internal_hosts to specify which internal hostnames are allowed in your webhook.

2개의 좋아요

관리자 패널에서 이 매개변수를 찾을 수 없습니다. 삭제되었거나 이름이 변경되었나요?
아마도 자체 호스팅 버전에서만 사용 가능한 것일까요?

아니요, allowed_internal_hosts 사이트 설정은 여전히 존재합니다.

하지만 디스코urses 호스팅 고객에게는 숨겨져 있는 것 같습니다. 다만 Hidden Settings on Discourse Hosted Sites 에는 목록에 포함되어 있지 않습니다. 그럼에도 불구하고 해당 서비스를 통해 호스팅을 받고 있고 설정을 찾을 수 없다면, 그들의 지원팀에 문의하는 것이 좋습니다.

자기 호스팅 버전에서만 사용 가능한 것 같아요!
사실 이게 더 말이 되네요. 클라우드 버전은 비공개 URL에 접근할 수 없으니까요.

1개의 좋아요