首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ServiceStack CookieException

ServiceStack CookieException
EN

Stack Overflow用户
提问于 2013-03-14 06:21:45
回答 1查看 398关注 0票数 1

在ServiceStack (3.9.33)下,我们得到以下异常:

代码语言:javascript
复制
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)

当我们的供应商(我们无法控制的代码)提交以下请求时:

代码语言:javascript
复制
Content-Length: 283401
Authorization: Basic --------------------------
Cookie: $Version=0; ss-id=----; $Path=/, $Version=0; ss-pid=---; $Path=/
Host: -----
User-Agent: Jakarta Commons-HttpClient/3.1

我们可以使用任何可能的变通方法或设置来避免异常吗?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2013-10-24 15:13:37

我今天在我的日志(ServiceStack 3.9.67)中收到了一堆相同的错误。

我不会担心试图避免异常或返回正常资源。我不是PHP开发人员,但我相信它们是恶意形成的请求-攻击者期望的是PHP服务器。他们要么试图探测PHP版本和环境工作目录,要么试图将环境变量设置为根目录(我不确定PHP所做的“cookie <->变量”的方向--魔术)。

编辑:我最终为它写了一个修复:https://github.com/ServiceStack/ServiceStack/pull/857

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15397631

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档