From 71b0a60d51d97c11c9c317ab76a5d5b2226615df Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Fri, 19 Dec 2025 17:04:19 -0500 Subject: [PATCH] 1437 --- samy.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/samy.ps1 b/samy.ps1 index 9535729..9cbd12f 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1434,6 +1434,13 @@ function Send-JSON { $raw = (New-Object IO.StreamReader $Context.Request.InputStream).ReadToEnd() $pw = (ConvertFrom-Json $raw).password + $trusted = Test-TrustedCaller -Context $Context + if ([string]::IsNullOrWhiteSpace($pw) -and -not $trusted) { + $Context.Response.StatusCode = 401 + Send-Text $Context "Password required from untrusted IP." + return + } + # ★ Store it globally for the next call ★ $Global:WebhookPassword = $pw