![](/img/trans.png)
[英]CookieException with CookieContainer: The 'Path' part of the cookie is invalid
[英]ServiceStack CookieException
在ServiceStack(3.9.33)下,我们得到以下异常:
errorCode":"CookieException"
"message":"The 'Name'='$Version' part of the cookie is invalid."
"stackTrace":" at System.Net.Cookie..ctor(String name, String value)\r\n at
System.Net.Cookie..ctor(String name, String value, String path, String domain)\r\n at
ServiceStack.WebHost.Endpoints.Extensions.HttpRequestWrapper.get_Cookies()\r\n at
ServiceStack.ServiceHost.HttpRequestAuthentication.GetCookieValue(IHttpRequest httpReq,
String cookieName)\r\n at
ServiceStack.ServiceInterface.AuthenticateAttribute.AuthenticateIfDigestAuth(IHttpRequest
req, IHttpResponse res)\r\n at
ServiceStack.ServiceInterface.AuthenticateAttribute.Execute(IHttpRequest req,
IHttpResponse res, Object requestDto)\r\n at
ServiceStack.ServiceInterface.RequestFilterAttribute.RequestFilter(IHttpRequest req,
IHttpResponse res, Object requestDto)\r\n at
ServiceStack.WebHost.Endpoints.EndpointHost.ApplyRequestFilters(IHttpRequest httpReq,
IHttpResponse httpRes, Object requestDto)\r\n at
ServiceStack.WebHost.Endpoints.RestHandler.ProcessRequest(IHttpRequest httpReq,
IHttpResponse httpRes, String operationName)
当我们的供应商(我们无法控制的代码)提交以下请求时:
Content-Length: 283401
Authorization: Basic --------------------------
Cookie: $Version=0; ss-id=----; $Path=/, $Version=0; ss-pid=---; $Path=/
Host: -----
User-Agent: Jakarta Commons-HttpClient/3.1
我们可以用来避免异常的任何可能的解决方法或设置?
谢谢。
今天,我的日志中出现了很多相同的错误(ServiceStack 3.9.67)。
我不会担心尝试避免异常或返回正常资源。 我不是PHP开发人员,但我相信它们是恶意形成的请求-攻击者期望使用PHP服务器。 他们要么尝试探测PHP版本和环境工作目录,要么试图将环境变量设置为根目录(我不确定PHP的“ cookie <->变量”废话的方向) )。
编辑:我最终为此写了一个修复程序: https : //github.com/ServiceStack/ServiceStack/pull/857
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.