当前位置:网站首页>URL jump vulnerability
URL jump vulnerability
2022-07-26 17:52:00 【Leisurely summer】
URL Jump Vulnerability (URL Redirection vulnerability ), Jump vulnerability is generally used for phishing attacks .
https://link.zhihu.com/?target=https://edu.lagou.com/
principle :
URL Jump vulnerabilities are essentially exploits Web Business with redirection function in application , Redirect users from one website to another . The simplest way to use it is to induce users to visit http://www.aaa.com?returnUrl=http://www.evil.com, With the help of www.aaa.com Let users access www.evil.com, This vulnerability is exploited, which is a loss to users and the company .
1、 Use scenarios
(1) The login function has always been URL Jump to the hardest hit area of the vulnerability , Users visit a business on the website , When it comes to account role permissions, you must jump to the login interface , In order to ensure that the user experience authentication is completed, it is necessary to automatically return to the page the user browsed before . This time, it happened URL Hidden danger of jump vulnerability .
for instance , For example, the user is visiting http://www.aaa.com/detail?sku=123456 The goods , Trigger login operation when adding shopping cart , Jump to the unified login authentication page to log in , At this time, the access link is http://login.aaa.com?returnUrl=http://www.aaa.com/detail?sku=123456, After the authentication is successful, the browser continues to return to the product details page to facilitate the user to purchase . if login.aaa.com Yes returnUrl The parameter check is not strict or even not checked , You can jump to any website through this link .

After login 302 Jump to Baidu home page , here returnUrl No inspection was carried out , You can jump to the third-party page at will . Same as login function , The exit function of the website also exists URL Jump the risk of vulnerability . Other similar jump functions include jump after SMS verification code authentication 、 Jump after sharing or collecting 、 Jump after authorizing the third party , Their common feature is to enter another page for some operation from one page , After the operation, return to the original page to continue browsing . In some multi-step operations , Click the next button to pass fromUrl Parameters , This parameter will become a hyperlink to return to the previous step , As shown below :

Even in some businesses callback Parameters also exist URL Jump Vulnerability . Common parameter values are return、redirect、url、jump、goto、target、link etc. , In the process of digging holes at ordinary times, you might as well pay attention to whether the request contains relatively complete URL Address , Test these parameters .
(2) If lagou.com One of the following web This vulnerability exists in the application , A malicious attacker can send a message to the user lagou.com Link to , But after the user opens , But came to the phishing website page , It will cause users to be attacked by phishing , Account stolen , Or the property related to the account is stolen .
(3) The scenario where the vulnerability occurs :
- The user login 、 Unified identity authentication office , After certification, it will jump
- User sharing 、 After the collection , Can jump
- Cross site authentication 、 After authorization , Can jump
- When you click on other website links , Can jump
- After the business is completed, jump to
- For example, change the password , After the modification, go to the landing page , Bind bank card , After binding successfully, return to the bank card recharge and other pages
- Such as evaluation system , Complete the questionnaire 、 Jump to the page after customer service evaluation and other business operations
(4) The reason for the vulnerability :
- When writing code, I didn't consider any URL Jump Vulnerability , Or not at all / I don't think this is a loophole ;
- Thoughtless when writing code , Use substring 、 Take suffixes and other methods to simply judge , Code logic can be bypassed ;
- Do some wonderful operations on the incoming parameters ( Domain name cut / Splicing / restructuring ) And judgment , Run counter to one's desire , Be bypassed ;
- The parsing of the original language URL、 Determine whether the function library of the domain name has a logical vulnerability or unexpected features , Can be bypassed ;
- The original language 、 The server / Container characteristics 、 Browser and other standards URL The protocol parsing process is so different that it is bypassed .
(5) Common parameter names
- redirect
- redirect_to
- redirect_url
- url
- jump
- jump_to
- target
- to
- link
- linkto
- domain
2、URL Jump vulnerability mining
Later, assume that the source domain name is :www.abc.com The domain to jump to is :www.evil.com ( go fishing )
(1) No inspection , Direct jump
// To obtain parameters
String url = request.getParameter("returnUrl");
// Redirect
response.sendRedirect(url);(2) Domain name string detection spoofing , The code is not perfect , Vulnerability
// To obtain parameters
String url = request.getParameter("returnUrl");
// Determine whether the domain name is included
if (url.indexOf("www.abc.com ") !=-1){
response.sendRedirect(url);
}http://www.abc.com?returnUrl=http://www.abc.com.evil.com
http://www.abc.com?returnUrl=http://www.evil.com/www.abc.com
(3)bypass The way
http://www.aaa.com?returnUrl=http://www.aaa.com.evil.com
http://www.aaa.com?returnUrl=http://www.evil.com/www.aaa.com
If you cooperate again URL Various characteristic symbols of , There are many ways to bypass . such as
Use question marks ?:
http://www.aaa.com?returnUrl=http://www.evil.com?www.aaa.com
Use backslashes :
http://www.aaa.com?returnUrl=http://www.evil.comwww.aaa.com
http://www.aaa.com?returnUrl=http://www.evil.com\www.aaa.com
utilize @ Symbol :
http://www.aaa.com?returnUrl=http://[email protected]
Use the well number #:http://www.aaa.com?returnUrl=http://www.evil.com#www.aaa.com
http://www.aaa.com?returnUrl=http://www.evil.com#www.aaa.com?www.
aaa.comMissing agreement :
http://www.aaa.com?returnUrl=/www.evil.com
http://www.aaa.com?returnUrl=//www.evil.com
Multiple jumps , namely aaa Companies trust ccc company ,ccc The company also has loopholes or provides jump Services :
http://www.aaa.com?returnUrl=http://www.ccc.com?jumpto=http://www.evil.com
3、 Protection plan
Limit referer、 add to token, This can prevent malicious users from constructing jump links and spreading them everywhere , The most fundamental way to fix this vulnerability is to strictly check the jump domain name .
- Code fixed jump address , Don't let users control variables
- The jump target address adopts the white list mapping mechanism such as 1 representative edu.lagou.com,2 representative job.lagou.com, Other log records
- Reasonable and sufficient verification mechanism , Verify the destination address of the jump , Inform the user of the jump risk when it is not your own address
边栏推荐
- Ascend target detection and recognition - customize your own AI application
- Definition of graph traversal and depth first search and breadth first search (I)
- Comparison between agile development and Devops
- 深度学习实验:Softmax实现手写数字识别
- 【云原生】 iVX 低代码开发 引入腾讯地图并在线预览
- 徽商期货网上开户安全吗?开户办理流程是怎样的?
- Analysis of interface testing
- 2.1.2 同步始终失败
- kaggle猫狗数据集开源——用于经典CNN分类实战
- 常用超好用正则表达式!
猜你喜欢

AI zhetianchuan DL regression and classification
![[template] segment tree 1](/img/60/9f73d00223c8878ffd8513b3b9adf7.jpg)
[template] segment tree 1

Summer Challenge openharmony greedy snake based on JS

我们被一个 kong 的性能 bug 折腾了一个通宵

【虚拟机数据恢复】意外断电导致XenServer虚拟机不可用,虚拟磁盘文件丢失的数据恢复案例

Tianyi cloud web application firewall (edge cloud version) supports the detection and interception of Apache spark shell command injection vulnerabilities

【OpenCV 例程 300篇】240. OpenCV 中的 Shi-Tomas 角点检测

【集训Day1】Spy dispatch

图的遍历的定义以及深度优先搜索和广度优先搜索(一)

Definition of graph traversal and depth first search and breadth first search (I)
随机推荐
Gan (generative adversarial network, GaN) generative countermeasure network
# MySQL 七种连接方式图解
跨站点请求伪造(CSRF)
Is it safe to open an account online now? Who do you want to open a stock account?
【虚拟机数据恢复】意外断电导致XenServer虚拟机不可用,虚拟磁盘文件丢失的数据恢复案例
ACL实验演示(Huawei路由器设备配置)
Tree DP problem
2.1.2 同步始终失败
kaggle猫狗数据集开源——用于经典CNN分类实战
[cloud native] IVX low code development was introduced into Tencent map and previewed online
236. 二叉树的最近公共祖先
【云原生】 iVX 低代码开发 引入腾讯地图并在线预览
SQL中去去重的三种方式
Centos安装docker以及mysql和redis环境
徽商期货网上开户安全吗?开户办理流程是怎样的?
#夏日挑战赛# OpenHarmony基于JS实现的贪吃蛇
即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
pip安装模块,报错
the loss outweighs the gain! Doctors cheated 2.1 million yuan and masters cheated 30000 yuan of talent subsidies, all of which were sentenced!
【集训Day1】Spy dispatch