Basic Auth. 改为使用标准身份验证(例如JWT、OAuth)。Authentication, token generation,中重新发明轮子password storage。使用标准。Max Retry和监禁功能。JWT Secret) 使暴力破解令牌变得非常困难。HS256或RS256)。TTL, RTTL) 尽可能短。redirect_uri服务器端以仅允许列入白名单的 URL。response_type=token)。state带有随机哈希的参数来防止 OAuth 身份验证过程中的 CSRF。HSTS带有 SSL 的标头来避免 SSL Strip 攻击。GET (read)、POST (create)、PUT/PATCH (replace/update)和,如果请求的方法不适合请求的资源,则使用DELETE (to delete a record)响应。405 Method Not Allowedcontent-type请求接受标头(内容协商)以仅允许您支持的格式(例如application/xml,application/json等),406 Not Acceptable如果不匹配,则以响应响应。content-type发布的数据(例如application/x-www-form-urlencoded、multipart/form-data、application/json等)。XSS、SQL-Injection、Remote Code Execution等)。credentials、Passwords、security tokens或),而是使用标准的 Authorization 标头。API keysQuota、Spike Arrest或Concurrent Rate Limit)并动态部署 API 资源。/me/orders而不是/user/654321/orders.UUID。XXE(XML 外部实体攻击)。Billion Laughs/XML bomb通过指数实体扩展攻击。X-Content-Type-Options: nosniff标头。X-Frame-Options: deny标头。Content-Security-Policy: default-src 'none'标头。X-Powered-By、Server、X-AspNet-Version等。content-type你的回应。如果你返回application/json,那么你的content-type回应是application/json。credentials、Passwords或security tokens。200 OK, 400 Bad Request, 401 Unauthorized,405 Method Not Allowed等)。原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。