内容简介:我正在为我的(基于rails的)api服务器构建一个基于令牌的认证库,它使用redis来存储生成的auth令牌.我担心的是:user_id = $redis.get(“auth:#{token}”),其中token是传递给authenticate_or_request_with_http_token的内容.如果这是SQL,那将是一个巨大的红旗 – 字符串插值SQL查询是非常不安全的.然而,据我所知,在redis密钥查询上进行字符串插值并不安全.我上面提到的声明的源代码是redis文档:
我正在为我的(基于rails的)api服务器构建一个基于令牌的认证库,它使用 redis 来存储生成的auth令牌.我担心的是:user_id = $redis.get(“auth:#{token}”),其中token是传递给authenticate_or_request_with_http_token的内容.
如果这是SQL,那将是一个巨大的红旗 – 字符串插值 SQL 查询是非常不安全的.然而,据我所知,在redis密钥查询上进行字符串插值并不安全.
我上面提到的声明的源代码是redis文档: http://redis.io/topics/security (在字符串转义和nosql注入标题下),但我想确保在我获得Bobby Tables攻击之前就是这种情况.
The Redis protocol has no concept of string escaping, so injection is impossible under normal circumstances using a normal client library. The protocol uses prefixed-length strings and is completely binary safe.
翻译自:https://stackoverflow.com/questions/22023538/is-it-possible-to-run-a-string-injection-attack-on-a-redis-query
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Web ReDesign 2.0
Kelly Goto、Emily Cotler / Peachpit Press / 2004-12-10 / USD 45.00
If anything, this volume's premise--that the business of Web design is one of constant change-has only proven truer over time. So much so, in fact, that the 12-month design cycles cited in the last ed......一起来看看 《Web ReDesign 2.0》 这本书的介绍吧!
随机密码生成器
多种字符组合密码
HEX HSV 转换工具
HEX HSV 互换工具