argon-theme
argon-theme copied to clipboard
[Bug] ajax_post_comment 不验证 captcha
主题版本
v1.3.5
Bug 类型
该 Bug 是后端问题
浏览器
此问题与前端无关
普遍性
是
问题描述
如题,后端 ajax handler 只负责生成新的验证码并将其发送至客户端,但是并不在后端进行验证。 因此,如果直接构造合适的 ajax post data,能够批量发送评论数据。
此外,在测试 bug 时发现,没有 cookies 啥的,即使套用同样的 post data,也会导致“博主”提示不正常?(如图二,上面两个是构造数据发送,下面两个是 web 端发送)
搜索 评论 验证码 等关键词未发现相同 issue。
复现步骤
- web 端发送评论
- 开发者工具抓到数据
- 用工具直接批量 post
截图
附加说明
No response
[error] 4302#0: *8784 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $commentCaptchaSeed in /www/wwwroot/[www.xxxxxxxxx.com/wp-content/themes/argon/comments.php](https://www.xxxxxxxxx.com/wp-content/themes/argon/comments.php) on line 231" while reading response header from upstream, client: ***.***.***.***, server: [www.xxxxxxxxx.com](https://www.xxxxxxxxx.com/), request: "GET /shuoshuo/xxxxxxxxxxxxx/ HTTP/2.0", upstream: "fastcgi://unix:/tmp/php-cgi-82.sock:", host: "[www.xxxxxxxxx.com](https://www.xxxxxxxxx.com/)", referrer: "https://www.xxxxxxxxx.com/"
怪不得日志报错呢 /comments.php 文件,第 231 行
<input id="post_comment_captcha_seed" value="<?php echo $commentCaptchaSeed;?>" style="display: none;"></input>