Guarding Against CSRF Vulnerability in Redis

Abstract: What is Redis CSRF vulnerability and how can we guarantee the security of Redis? Redis's CSRF vulnerability was exposed in February 2017, and the author of Redis has fixed the vulnerability in the latest release of Redis 3.2.7. This article briefly introduces the concept of CSRF vulnerability and the best practices to keep Redis instances secure.

What is CSRF?

Cross-site request forgery (CSRF or XSRF), also known as "One Click Attack" or "Session Riding", is a form of malicious website use.

The figure above shows a simple model of CSRF attacks. A user visits the malicious website Web B, which returns an HTTP message to the user asking the user to visit website Web A. If the user has set Web A as a trusted site, the access request will be executed as if the user sent the request on his/her own.

Redis CSRF Attack Model

Based on the principle of CSRF above, malicious websites may make a user send an HTTP request to Redis. Because Redis supports text protocols, and will not break off the connection in the case of illegal protocols during protocol resolution, the attacker can then add a Redis command after the normal HTTP request to execute the command on Redis. If the user and Redis do not use a password for verification, the Redis command will then be executed normally. The attacker can then encrypt data to extort money, just like the MongoDB ransom incident in January 2017.

Repairing the Kernel

The author of Redis fixed the problem in Redis v3.2.7, implementing special processing for the POST and Host: keywords, logging the events, and disconnecting to avoid execution of subsequent legal requests to Redis.

Redis Security Risks

Earlier, Redis exposed a security vulnerability that hackers may get the root permission of Redis services under certain conditions. The causes of these security vulnerabilities can be primarily attributed to users' lack of use and understanding of Redis's security mechanisms, as well as lack of Redis O&M experience. In comparison, Alibaba Cloud ApsaraDB for Redis provides more secure solutions for your on-cloud Redis services.

ApsaraDB for Redis Security Code

Intranet access to avoid Internet access

Alibaba Cloud ApsaraDB for Redis only provides trusted intranet access. You cannot access Alibaba Cloud ApsaraDB for Redis via the Internet.

Physical network isolation

Alibaba Cloud ApsaraDB for Redis's physical network and user network are physically isolated. Users' virtual machines are not allowed to directly access the backend physical machine network.

VPC network isolation

If you are an Alibaba Cloud user using the VPC network, only the services in the same VPC are inter-accessible.

Whitelist

Alibaba Cloud ApsaraDB for Redis supports whitelist settings. The feature is currently not available in the console yet. With this feature, you can set a whitelist for allowed users directly using the console.

Password access

Alibaba Cloud ApsaraDB for Redis enforces password authentication for instances in the classic network. You are recommended to set a complex password to prevent it from being cracked.

Access permission isolation

Each backend instance of Alibaba Cloud ApsaraDB for Redis is isolated in the ACL and accessible directory. Each instance is only allowed to access the path of its own instance so that inter-instance interference can be avoided.

Disabling dangerous commands

Alibaba Cloud ApsaraDB for Redis disables some dangerous system management commands such as "config" and "save". If you want to modify this parameter, you need to pass the secondary authentication in the console. This also avoids direct operations on the backend configuration files and management commands.

Security monitoring

Alibaba Cloud ApsaraDB for Redis has a complete security monitoring system for physical machines. It regularly scans and updates the security monitoring policies to discover security risks as soon as possible.

Redis cluster password

Native Redis 3.0 cluster version does not support password verification. Alibaba Cloud ApsaraDB for Redis cluster version supports password verification, which improves security.

时间: 2024-07-28 12:39:04

Guarding Against CSRF Vulnerability in Redis的相关文章

Flash CSRF 恶意利用攻击及防御

Flash CSRF名词解释 CSRF(Cross-site request forgery跨站请求伪造,是一种对网站的恶意利用,CSRF则通过伪装来自受信任用户的请求来利用受信任的网站. Flash CSRF通常是由于Crossdomain.xml文件配置不当造成的,利用方法是使用swf来发起跨站请求伪造. Flash CSRF形成的原因 看看如何寻找Flash CSRF: 首先我们要知道怎么形成CSRF的,CSRF形成的原因大概有以下几种: Flash跨域权限管理文件Crossdomain.

nginx+tomcat实现负载均衡,使用redis session共享_nginx

环境准备 1.准备一台nginx服务器 ip192.168.1.133 端口81 安装过程: #首先安装依赖: yum -y install gcc-c++ yum -y install pcre pcre-devel yum -y install zlib zlib-devel yum -y install openssl openssl-devel #注意 : 安装nginx必须使用 root 用户安装 #创建一个nginx目录 mkdir /usr/local/src/nginx #进入到

防CSRF攻击:一场由重复提交的问题引发的前端后端测试口水战

重复提交,这是一直以来都会存在的问题,当在网站某个接口调用缓慢的时候就会有可能引起表单重复提交的问题,不论form提交,还是ajax提交都会有这样的问题,最近在某社交app上看到这么一幕,这个团队没有做重复提交的验证,从而导致了数据有很多的重复提交,在这里我们不讨论谁对谁错,问题解决即可.    首先的一种方式,在前端加入loading,或者是blockUI,在ios以及安卓上也是类似,效果如下:  这个时候整个页面不能再用鼠标点击,只能等待请求响应以后才能操作 具体可以参考blockUI这个插

Redis 数据备份与恢复

Redis SAVE 命令用于创建当前数据库的备份. 语法 redis Save 命令基本语法如下: redis 127.0.0.1:6379> SAVE 实例 redis 127.0.0.1:6379> SAVE OK 该命令将在 redis 安装目录中创建dump.rdb文件. 恢复数据 如果需要恢复数据,只需将备份文件 (dump.rdb) 移动到 redis 安装目录并启动服务即可.获取 redis 目录可以使用 CONFIG 命令,如下所示: redis 127.0.0.1:6379

Redis之七种武器

长生剑.孔雀翎.碧玉刀.多情环.离别钩.霸王枪.拳头是古龙笔下的七种武器,而本文打算将Redis的几种使用方式 Strings.Hashs.Lists.Sets.Sorted Sets.Pub/Sub.Transactions 也比作七种武器,为大家讲解Redis的七种特性,并列举其适合的应用场景. Strings Strings 数据结构是简单的key-value类型,value其实不仅是String,也可以是数字.使用Strings类型,你可以完全实现目前 Memcached 的功能,并且效

java实现redis数据库访问

分析亚马逊AWS数据存储-----http://edu.csdn.net/course/detail/873 一.server端安装 1.下载 https://github.com/MSOpenTech/redis 可看到当前可下载版本:redis2.6 下载windows平台文件: 解压后,选择当前64位win7系统对应的版本: 2.安装 1)解压后将里面所有文件拷贝至redis安装目录: 几个exe程序的功能:   redis-benchmark.exe:性能测试,用以模拟同时由N个客户端发

Redis内存数据库操作命令详解

一.连接操作相关的命令    quit关闭连接connection    auth简单密码认证 二.对value操作的命令    exists(key)确认一个key是否存在    del(key)删除一个key    type(key)返回值的类型    keys(pattern)返回满足给定pattern的所有key    randomkey随机返回key空间的一个key    rename(oldname, newname)将key由oldname重命名为newname若newname存在

Windows Server 2016 配置指南 之 安装 PHP redis 拓展

前文 安装 Redis3.0 介绍了服务器安装 Redis3.0,但是就像我们安装了 Mysql 依旧需要然后对应的 php 驱动拓展一样,redis 也是.这里就讲一下如何安装 Redis 的 php 拓展. 尽管 PHP7 正式版出来已经有个把月数了,但是提供 Windows 系统使用的 phpredis 已经没有更新.见地址:http://windows.php.net/downloads/pecl/releases/redis/ ,依旧是旧的. 不过么,phpredis 的 php7 分

java如何队列同步redis?

问题描述 java如何队列同步redis? 就是数据批量插入redis,然后再同步插入到数据库里面,怎么搞 解决方案 java redis使用之利用jedis实现redis消息队列0135 java redis使用之利用jedis实现redis消息队列java redis使用之利用jedis实现redis消息队列 解决方案二: 一般是数据先插入数据库,然后再利用触发器等把数据插入redis.或者用过期方式来从数据库同步数据到redis