TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Django Security Releases Issued

61 pointsby zainover 14 years ago

5 comments

astonover 14 years ago
These guys are not the only ones to make this mistake. Check the first line of Tornado's XSRF check:<p><pre><code> def check_xsrf_cookie(self): """Verifies that the '_xsrf' cookie matches the '_xsrf' argument. To prevent cross-site request forgery, we set an '_xsrf' cookie and include the same '_xsrf' value as an argument with all POST requests. If the two do not match, we reject the form submission as a potential forgery. See http://en.wikipedia.org/wiki/Cross-site_request_forgery """ if self.request.headers.get("X-Requested-With") == "XMLHttpRequest": return token = self.get_argument("_xsrf", None) if not token: raise HTTPError(403, "'_xsrf' argument missing from POST") if self.xsrf_token != token: raise HTTPError(403, "XSRF cookie does not match POST argument")</code></pre>
评论 #2196307 未加载
评论 #2196299 未加载
评论 #2196700 未加载
ubernostrumover 14 years ago
Since this also affected Rails, a minor clarification:<p>We spoke with Ben Bangert of Pylons/Pyramid, and did some checking of source code there and in other projects, and as far as we knew last week, Django was the only Python framework affected by the CSRF issue. If you find another project which is affected, please notify them ASAP.
nbpooleover 14 years ago
Cross-posting the recent discussion about the new Ruby on Rails release, which included a fix for the same CSRF issue:<p><a href="http://news.ycombinator.com/item?id=2195283" rel="nofollow">http://news.ycombinator.com/item?id=2195283</a>
bryanhover 14 years ago
A bothersome change, especially for all those employing jQuery plugins that don't have a quick method to add the CSRF token to AJAX requests.<p>I think I might just add @csrf_exempt, as long as we aren't changing vital info via the request...
评论 #2196417 未加载
svllaover 14 years ago
"This is technically backwards-incompatible, but the security risks have been judged to outweigh the compatibility concerns in this case."<p>Good choice. I wonder when weak password hashing in Django will be given the same exception.
评论 #2196652 未加载
评论 #2196498 未加载
评论 #2196410 未加载