Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 加人机验证的时候正则表达式问题 #459

Closed
mu0641 opened this issue Nov 22, 2023 · 3 comments
Closed

[Bug] 加人机验证的时候正则表达式问题 #459

mu0641 opened this issue Nov 22, 2023 · 3 comments
Labels
question questions about software

Comments

@mu0641
Copy link

mu0641 commented Nov 22, 2023

问题描述

加人机验证的时候要判断Referer 是否不包含: ^(?:(?!bing|baidu).)*$ ,如果Referer 是空的整个条件就不成立了,实际上空字符也是能匹配我上面这个正则的

版本号

3.12.2

复现方法

加上我这个配置就可以了

期望的结果

期望尽快修复

@DeronW
Copy link
Collaborator

DeronW commented Nov 22, 2023

@mu0641 请再描述的详细些

现在的人机验证没有添加内置规则,是后面配置的,你的正则遇到了什么问题?
判断 百度、必应 爬虫的方法没有推荐标准,waf 不能内置根据 refer 判断,很容易被爬虫伪装

@mu0641
Copy link
Author

mu0641 commented Nov 22, 2023

你们的逻辑是不是如果referer为空就不做正则判断了,就算我提供了正则

@Lorna0
Copy link
Collaborator

Lorna0 commented Nov 24, 2023

请求头为空时(无 key,或者有 key 无 value ),规则中的正则是直接跳过、返回 “未命中” 的。因为 “请求头为空” 的这种正则容易配错,导致业务中断,底层就干脆禁止了。因为涉及底层引擎,改动成本有点大。

不过想要放行百度、bing 搜索引擎的话,这样正则配置确实不太合适,容易伪造。还是尽量用搜索引擎的官方方法判断,可以在相关 issue 里跟进:

@Lorna0 Lorna0 added the question questions about software label Nov 24, 2023
@Lorna0 Lorna0 closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question questions about software
Projects
None yet
Development

No branches or pull requests

3 participants