WO2020259389A1 - 一种csrf漏洞的检测方法及装置 - Google Patents
一种csrf漏洞的检测方法及装置 Download PDFInfo
- Publication number
- WO2020259389A1 WO2020259389A1 PCT/CN2020/096900 CN2020096900W WO2020259389A1 WO 2020259389 A1 WO2020259389 A1 WO 2020259389A1 CN 2020096900 W CN2020096900 W CN 2020096900W WO 2020259389 A1 WO2020259389 A1 WO 2020259389A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- access
- detected
- token
- access request
- url site
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0807—Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1433—Vulnerability analysis
Definitions
- the present invention relates to the technical field of financial technology (Fintech), in particular to a method and device for detecting CSRF vulnerabilities.
- Cross-site request forgery is a malicious use of websites. Some financial platforms have loopholes in business functions. CSRF allows hackers to impersonate legitimate users, allowing legitimate users to trigger dangerous operations such as financial payments and transfers without their knowledge, directly affecting the security of users’ funds and accounts.
- the embodiment of the present invention provides a method for detecting CSRF vulnerabilities, which aims to solve the problems of single detection means for CSRF vulnerabilities and low detection accuracy in the prior art.
- an embodiment of the present invention provides a method for detecting cross-site request forgery CSRF vulnerabilities, including:
- the third access request carrying the first user login status information is sent to the URL site to be detected; if the third access response corresponding to the third access request is in the third access response If the third Token is consistent with the first Token, it is determined that the URL site to be detected has a CSRF vulnerability.
- the detection method of CSRF vulnerabilities adds Tokens for different user information to detect. If different users have the same token in the access response, there is a greater possibility of CSRF vulnerabilities; After the Token of the information is detected, Token detection in different periods is performed; if the same user has the same Token in different periods, there is a greater possibility of CSRF vulnerability. It can be seen that the above technical solution enriches the Token detection methods by introducing the Token detection of different user information and the Token detection of the same user at different times, thereby improving the detection accuracy.
- the method further includes:
- the fourth access response corresponding to the fourth access request matches the fifth access response, it is determined that the URL site to be detected has a CSRF vulnerability; the fifth access response is a legitimate access request of the URL site to be detected the response to. It should be noted that the fourth access request may also be the first access request, and therefore the fifth access response may also be the first access response.
- the detection method of the constructed access request and the legal access request is further provided; if the response of the constructed access request is the same as the legal one If the response of the access request matches, it is determined that there is a CSRF vulnerability. It can be seen from the above technical solutions that the embodiment of the present invention further adds detection means, thereby improving the detection accuracy.
- the interaction mode of the URL site is Ajax format; before sending the fourth access request to the URL site to be detected, the method further includes:
- blacklist judgment is also performed before the token detection of different user information; if the Token is in the blacklist, it is determined that there is a CSRF vulnerability; otherwise, the token detection of different user information is performed.
- This technical solution can further improve the detection efficiency of CSRF vulnerabilities.
- embodiments of the present invention also provide a device for detecting CSRF vulnerabilities in cross-site request forgery, the device including:
- the detection unit when the first Token and the second Token are inconsistent, when a set time arrives, send a third access request carrying the login status information of the first user to the URL site to be detected; If the third Token in the third access response corresponding to the third access request is consistent with the first Token, it is determined that the URL site to be detected has a CSRF vulnerability.
- the detection unit is further configured to:
- the fourth access response corresponding to the fourth access request matches the fifth access response, it is determined that the URL site to be detected has a CSRF vulnerability; the fifth access response is a legitimate access request of the URL site to be detected the response to.
- the detection device further includes:
- the obtaining unit is used to crawl each data packet of the URL site to be detected
- the determining unit is further configured to determine that the first Token and the second Token are not in the blacklist.
- an embodiment of the present invention also provides a computing device, including:
- the processor is configured to call the program instructions stored in the memory, and execute the method of the first aspect or any one of the embodiments of the first aspect according to the obtained program.
- FIG. 1 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention
- FIG. 2 is a schematic diagram of the implementation process of a CSRF vulnerability detection method provided by an embodiment of the present invention
- an embodiment of the present invention provides a method for detecting a cross-site request forgery CSRF vulnerability, which includes the following steps:
- S12. Determine the second Token carried in the second access response returned by the URL site to be detected; the second access response is sent in response to the second access request carrying the login status information of the second user; the first user Different from the second user.
- the set time in step S14 can be set by itself, so as to meet the effective use time of the cookie information. Although this step is explained by taking the first token as an example, in fact it can also be the second token or the third token, as long as the token meets the time of two visits and reaches the set time.
- step S15 If the third token in the third access response corresponding to the third access request is consistent with the first token, it is determined that the URL site to be detected has a CSRF vulnerability.
- Token detection of different user information is performed in step S13 to avoid CSRF vulnerabilities caused when different users have the same Token; in step S15, Token detection of the same user in different periods is performed, thereby avoiding the validity period of the token. CSRF vulnerability caused by too long.
- the method further includes if the third Token and the third access response in the third access response corresponding to the third access request of the URL site to be detected If the Token is inconsistent, the method further includes:
- Manner 1 Crawling each data packet of the URL site to be detected; obtaining the first access response and the second access response from the data packets.
- Manner 2 Construct the first access request and send it to the URL site to be detected; construct the second access request and send it to the URL site to be detected.
- Ajax tag in the crawled page code Through the Ajax tag in the crawled page code, it can be judged whether it is an Ajax interactive access request. If it is judged that the submission is the Ajax interactive mode, the fourth access request sent by the Ajax interactive mode is constructed by replacing the send data.
- An example of Ajax interaction is as follows code 3:
- the browser will verify whether the client and server are in the same domain, and if they are not in the same domain. You need to set the withCredentials attribute of the sender to True, that is, support for carrying cookie information during cross-domain access. In other words, the browser of the access device 101 needs to be set to carry cookie information when supporting cross-domain access, so that the above detection process can be performed.
- a cross-domain request means that the domain of the current request is different from the domain of the resource pointed to by the request.
- the protocol, domain name, and port number are the same, it is the same domain.
- the browser of the access device 101 does not verify whether its domain is the same as the domain of the site to be detected, and sends it directly, so there is no need to set the browser of the access device 101 to support cross Domain request.
- the browser of the access device 101 will check whether the domain it is in is the same as the domain of the site to be detected. If it is different, the browser of the access device 101 will not send the request. When going out, you need to set the browser of the access device 101 to support cross-domain requests.
- the embodiment of the present invention also provides a detection device for cross-site request forgery CSRF vulnerabilities. Since the principle of the above device to solve the problem is similar to the method for detecting cross-site request forgery CSRF vulnerabilities, the implementation of the above device can be See the implementation of the method, and the repetition will not be repeated.
- FIG. 3 it is a schematic structural diagram of a CSRF vulnerability detection device provided by an embodiment of the present invention, including: a determination unit 32 and a detection unit 33, wherein:
- the determining unit used to determine whether the first access identifier Token carried in the first access response returned by the URL site to be detected is consistent with the second Token carried in the second access response returned by the URL site to be detected;
- the access response is sent in response to the first login request carrying the login status information of the first user;
- the second access response is sent in response to the second access request carrying the login status information of the second user; the first user and the first user Two users are different;
- the detection unit when the first Token and the second Token are inconsistent, when a set time arrives, send a third access request carrying the login status information of the first user to the URL site to be detected; If the third Token in the third access response corresponding to the third access request is consistent with the first Token, it is determined that the URL site to be detected has a CSRF vulnerability.
- the fourth access response corresponding to the fourth access request is consistent with the fifth access response, it is determined that the URL site to be detected has a CSRF vulnerability; the fifth access response is a legitimate access request of the URL site to be detected the response to.
- the detection device further includes:
- the acquiring unit 31 is configured to crawl each data packet of the URL site to be detected;
- the determining unit is further configured to determine that the first Token and the second Token are not in the blacklist.
- the cross-site request forgery CSRF defense authentication device provided by the foregoing embodiment of the present application can be implemented by a computer program.
- Those skilled in the art should be able to understand that the above module division method is only one of many module division methods. If it is divided into other modules or not divided into modules, as long as the cross-site request forgery CSRF defense authentication device has the above functions, it should be Within the scope of protection of this application.
- the processor is configured to call the program instructions stored in the memory, and execute the CSRF vulnerability detection method in the foregoing embodiment according to the obtained program.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
Claims (10)
- 一种跨站请求伪造CSRF漏洞的检测方法,其特征在于,所述方法包括:确定待检测URL站点返回的第一访问响应中携带的第一访问标识Token与所述待检测URL站点返回的第二访问响应中携带的第二Token是否一致;所述第一访问响应针对携带第一用户登录态信息的第一访问请求发送的;所述第二访问响应是针对携带第二用户登录态信息的第二访问请求发送的;所述第一用户与所述第二用户不同;若不一致,则在设定时间到达时,向所述待检测URL站点发送携带所述第一用户登录态信息的第三访问请求;若所述第三访问请求对应的第三访问响应中的第三Token与所述第一Token一致,则确定所述待检测URL站点存在CSRF漏洞。
- 如权利要求1所述的检测方法,其特征在于,若所述第三访问请求对应的第三访问响应中的第三Token与所述第一Token不一致,所述方法还包括:构造符合所述待检测URL站点的交互方式的第四访问请求;向所述待检测URL站点发送所述第四访问请求;若所述第四访问请求对应的第四访问响应与第五访问响应匹配,则确定所述待检测URL站点存在CSRF漏洞;所述第五访问响应是所述待检测URL站点的针对合法访问请求的响应。
- 如权利要求2所述的检测方法,其特征在于,所述URL站点的交互方式为Ajax;向所述待检测URL站点发送所述第四访问请求之前,还包括:设置所述第四访问请求的发送端支持跨域访问时携带cookie信息。
- 如权利要求1所述的检测方法,其特征在于,确定待检测URL站点返回的第一访问响应中携带的第一访问标识Token与所述待检测URL页面返 回的第二访问响应中携带的第二Token是否一致之前,还包括:爬取所述待检测URL站点的各数据包;从所述各数据包中获取所述第一访问响应和所述第二访问响应;或构造所述第一访问请求并发送至所述待检测URL站点;构造所述第二访问请求并发送至所述待检测URL站点。
- 如权利要求1所述的检测方法,其特征在于,确定待检测URL站点返回的第一访问响应中携带的第一访问标识Token与所述待检测URL页面返回的第二访问响应中携带的第二Token是否一致之前,还包括:确定所述第一Token和所述第二Token不在黑名单中。
- 一种跨站请求伪造CSRF漏洞的检测装置,其特征在于,所述装置包括:确定单元:用于确定待检测URL站点返回的第一访问响应中携带的第一访问标识Token与所述待检测URL站点返回的第二访问响应中携带的第二Token是否一致;所述第一访问响应针对携带第一用户登录态信息的第一登录请求发送的;所述第二访问响应是针对携带第二用户登录态信息的第二访问请求发送的;所述第一用户与所述第二用户不同;检测单元:用于在所述第一Token和所述第二Token不一致时,在设定时间到达时,向所述待检测URL站点发送携带所述第一用户登录态信息的第三访问请求;若所述第三访问请求对应的第三访问响应中的第三Token与所述第一Token一致,则确定所述待检测URL站点存在CSRF漏洞。
- 如权利要求6所述的检测装置,其特征在于,所述检测单元还用于:构造符合所述待检测URL站点的交互方式的第四访问请求;向所述待检测URL站点发送所述第四访问请求;若所述第四访问请求对应的第四访问响应与第五访问响应匹配,则确定所述待检测URL站点存在CSRF漏洞;所述第五访问响应是所述待检测URL站点的针对合法访问请求的响应。
- 如权利要求6所述的检测装置,其特征在于,还包括:获取单元,用于爬取所述待检测URL站点的各数据包;所述确定单元:还用于确定所述第一Token和所述第二Token不在黑名单中。
- 一种计算机设备,其特征在于,包括:存储器,用于存储程序指令;处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1至5任一项所述的方法。
- 一种计算机可读非易失性存储介质,其特征在于,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行如权利要求1至5任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910549709.XA CN110113366B (zh) | 2019-06-24 | 2019-06-24 | Csrf漏洞的检测方法及装置,计算设备和存储介质 |
| CN201910549709.X | 2019-06-24 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020259389A1 true WO2020259389A1 (zh) | 2020-12-30 |
Family
ID=67495661
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/096900 Ceased WO2020259389A1 (zh) | 2019-06-24 | 2020-06-18 | 一种csrf漏洞的检测方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110113366B (zh) |
| WO (1) | WO2020259389A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114357460A (zh) * | 2021-12-28 | 2022-04-15 | 中国农业银行股份有限公司 | 漏洞检测方法、装置、设备及存储介质 |
| CN114499960A (zh) * | 2021-12-24 | 2022-05-13 | 深圳开源互联网安全技术有限公司 | 一种csrf漏洞识别方法、装置及计算机可读存储介质 |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110113366B (zh) * | 2019-06-24 | 2022-12-27 | 深圳前海微众银行股份有限公司 | Csrf漏洞的检测方法及装置,计算设备和存储介质 |
| CN111104675A (zh) * | 2019-11-15 | 2020-05-05 | 泰康保险集团股份有限公司 | 系统安全漏洞的检测方法和装置 |
| CN111404937B (zh) * | 2020-03-16 | 2021-12-10 | 腾讯科技(深圳)有限公司 | 一种服务器漏洞的检测方法和装置 |
| CN111737695B (zh) * | 2020-06-24 | 2025-02-07 | 深圳前海微众银行股份有限公司 | 白名单优化方法、装置、设备与计算机可读存储介质 |
| CN111597424A (zh) * | 2020-07-21 | 2020-08-28 | 平安国际智慧城市科技股份有限公司 | 爬虫识别方法、装置、计算机设备和存储介质 |
| CN112419674A (zh) * | 2020-10-26 | 2021-02-26 | 四川大学 | 一种泥石流地质灾害的监测系统及方法 |
| CN112866265B (zh) * | 2021-01-27 | 2023-03-24 | 湖南快乐阳光互动娱乐传媒有限公司 | 一种csrf攻击防护方法及装置 |
| CN114567472B (zh) * | 2022-02-22 | 2024-07-09 | 深信服科技股份有限公司 | 一种数据处理方法、装置、电子设备及存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100146291A1 (en) * | 2008-12-08 | 2010-06-10 | Oracle International Corporation | Secure framework for invoking server-side apis using ajax |
| CN108429746A (zh) * | 2018-03-06 | 2018-08-21 | 华中科技大学 | 一种面向云租户的隐私数据保护方法及系统 |
| CN108769070A (zh) * | 2018-06-30 | 2018-11-06 | 平安科技(深圳)有限公司 | 一种越权漏洞检测方法及装置 |
| CN110113366A (zh) * | 2019-06-24 | 2019-08-09 | 深圳前海微众银行股份有限公司 | 一种csrf漏洞的检测方法及装置 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8601586B1 (en) * | 2008-03-24 | 2013-12-03 | Google Inc. | Method and system for detecting web application vulnerabilities |
| CN104573486B (zh) * | 2013-10-16 | 2018-09-28 | 深圳市腾讯计算机系统有限公司 | 漏洞检测方法和装置 |
| CN104660556B (zh) * | 2013-11-20 | 2018-06-01 | 深圳市腾讯计算机系统有限公司 | 跨站伪造请求漏洞检测的方法及装置 |
| CN108197467A (zh) * | 2018-01-11 | 2018-06-22 | 郑州云海信息技术有限公司 | 一种csrf漏洞的自动化检测方法及系统 |
-
2019
- 2019-06-24 CN CN201910549709.XA patent/CN110113366B/zh active Active
-
2020
- 2020-06-18 WO PCT/CN2020/096900 patent/WO2020259389A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100146291A1 (en) * | 2008-12-08 | 2010-06-10 | Oracle International Corporation | Secure framework for invoking server-side apis using ajax |
| CN108429746A (zh) * | 2018-03-06 | 2018-08-21 | 华中科技大学 | 一种面向云租户的隐私数据保护方法及系统 |
| CN108769070A (zh) * | 2018-06-30 | 2018-11-06 | 平安科技(深圳)有限公司 | 一种越权漏洞检测方法及装置 |
| CN110113366A (zh) * | 2019-06-24 | 2019-08-09 | 深圳前海微众银行股份有限公司 | 一种csrf漏洞的检测方法及装置 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114499960A (zh) * | 2021-12-24 | 2022-05-13 | 深圳开源互联网安全技术有限公司 | 一种csrf漏洞识别方法、装置及计算机可读存储介质 |
| CN114499960B (zh) * | 2021-12-24 | 2024-03-22 | 深圳开源互联网安全技术有限公司 | 一种csrf漏洞识别方法、装置及计算机可读存储介质 |
| CN114357460A (zh) * | 2021-12-28 | 2022-04-15 | 中国农业银行股份有限公司 | 漏洞检测方法、装置、设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110113366A (zh) | 2019-08-09 |
| CN110113366B (zh) | 2022-12-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020259389A1 (zh) | 一种csrf漏洞的检测方法及装置 | |
| US10554655B2 (en) | Method and system for verifying an account operation | |
| US8122251B2 (en) | Method and apparatus for preventing phishing attacks | |
| US9578004B2 (en) | Authentication of API-based endpoints | |
| US9870464B1 (en) | Compromised authentication information clearing house | |
| KR102069759B1 (ko) | 캡차(captcha) 챌린지의 동적 업데이트 | |
| US9838384B1 (en) | Password-based fraud detection | |
| TWI620090B (zh) | 用於偵測網路釣魚之登入失敗序列 | |
| US10574697B1 (en) | Providing a honeypot environment in response to incorrect credentials | |
| CN102571846B (zh) | 一种转发http请求的方法及装置 | |
| US10015191B2 (en) | Detection of man in the browser style malware using namespace inspection | |
| US10176318B1 (en) | Authentication information update based on fraud detection | |
| CN103618717B (zh) | 多账户客户信息的动态认证方法、装置和系统 | |
| US10015171B1 (en) | Authentication using metadata from posts made to social networking websites | |
| US20210099431A1 (en) | Synthetic identity and network egress for user privacy | |
| US10630574B2 (en) | Link processing method, apparatus, and system | |
| US11770385B2 (en) | Systems and methods for malicious client detection through property analysis | |
| CN104734849A (zh) | 对第三方应用进行鉴权的方法及系统 | |
| US10834074B2 (en) | Phishing attack prevention for OAuth applications | |
| CN110704820A (zh) | 登录处理方法、装置、电子设备和计算机可读存储介质 | |
| CN104601558A (zh) | 防御跨站请求伪造攻击的方法及装置 | |
| CA2844888A1 (en) | System and method of extending a host website | |
| US20200110868A1 (en) | Augmented push authentication | |
| US12039054B2 (en) | Systems and methods for dynamic detection of vulnerable credentials | |
| CN110858836A (zh) | 网络攻击防御方法及设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20830733 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20830733 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 05/04/2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20830733 Country of ref document: EP Kind code of ref document: A1 |
