Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add internal to reserved headers

Thiago Araujo da Silva74aad2a43bf6
diff --git a/backend/src/services/alert/alert-channel-types.ts b/backend/src/services/alert/alert-channel-types.ts
index 3aa8d42cc3..ae4328e61c 100644
--- a/backend/src/services/alert/alert-channel-types.ts
+++ b/backend/src/services/alert/alert-channel-types.ts
@@ -94,7 +94,14 @@ export const EmailChannelConfigSchema = z.object({}).strip();
export const WEBHOOK_MAX_HEADERS = 20;
-const WEBHOOK_RESERVED_HEADERS = ["content-type", "x-infisical-signature"];
+const WEBHOOK_RESERVED_HEADERS = [
+ "content-type",
+ "x-infisical-signature",
+ "content-length",
+ "transfer-encoding",
+ "connection",
+ "host"
+];
const httpHeaderNameRegex = new RE2("^[A-Za-z0-9!#$%&'*+.^_`|~-]+$");
const noLineBreaksRegex = new RE2("^[^\\r\\n]*$");
diff --git a/backend/src/services/alert/channels/alert-channels.test.ts b/backend/src/services/alert/channels/alert-channels.test.ts
index b4cfe1374b..dee866d384 100644
--- a/backend/src/services/alert/channels/alert-channels.test.ts
+++ b/backend/src/services/alert/channels/alert-channels.test.ts
@@ -234,7 +234,9 @@ describe("WebhookChannelConfigSchema headers", () => {
const result = withHeaders([{ key: "Content-Type", value: "text/plain" }]);
expect(result.success).toBe(false);
expect(result.error?.issues[0].message).toBe("Header 'Content-Type' is set by Infisical and cannot be overridden");
- expect(withHeaders([{ key: "X-Infisical-Signature", value: "x" }]).success).toBe(false);
+ ["X-Infisical-Signature", "Content-Length", "Transfer-Encoding", "Connection", "Host"].forEach((key) => {
+ expect(withHeaders([{ key, value: "x" }]).success).toBe(false);
+ });
});
test("rejects duplicate names regardless of case", () => {
diff --git a/docs/documentation/platform/pki/applications/alerting/webhook-alerts.mdx b/docs/documentation/platform/pki/applications/alerting/webhook-alerts.mdx
index 8e4f3fb535..356a3df715 100644
--- a/docs/documentation/platform/pki/applications/alerting/webhook-alerts.mdx
+++ b/docs/documentation/platform/pki/applications/alerting/webhook-alerts.mdx
@@ -35,7 +35,7 @@ Infisical sends every custom header you add on the channel with each request. Us
A channel can have up to 20 headers. Header values are encrypted, and the API returns them as `******` after you save the channel. When you edit the channel, leave a value unchanged to keep it, or enter a new one to replace it.
-You can't set the `Content-Type` and `x-infisical-signature` headers, because Infisical sets them on every request.
+You can't set the `Content-Type`, `Content-Length`, `Transfer-Encoding`, `Connection`, `Host`, and `x-infisical-signature` headers, because Infisical sets them on every request.
## Webhook event types