# Message Bus 上的 403 错误

**URL:** https://meta.discourse.org/t/403-error-on-message-bus/277637
**Category:** Development
**Tags:** rest-api
**Created:** [2023年九月3日 10:32 UTC](https://meta.discourse.org/t/403-error-on-message-bus/277637 "2023-09-03T10:32:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yusufipek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yusufipek/32/328791_2.png) [@yusufipek](https://meta.discourse.org/u/yusufipek)
#### Post date: [2023年九月3日 10:32 UTC](https://meta.discourse.org/t/403-error-on-message-bus/277637/1 "2023-09-03T10:32:02Z")

</div>

您好！我正在尝试 WAF 下的 Discourse，并且收到 **仅** 消息总线 POST 请求的 403 错误。我知道这不是 Discourse 特有的问题，但我尝试了一天，仍然不明白为什么消息总线会收到 403 请求。任何猜测/想法都将不胜感激！谢谢。

错误消息：

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/8/e/58e37e1e7d7dd7e8a0dfda9dc8229a69964092b7.png)

---

<div class="post-metadata">

### Author: ![yusufipek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yusufipek/32/328791_2.png) [@yusufipek](https://meta.discourse.org/u/yusufipek)
#### Post date: [2023年九月3日 15:08 UTC](https://meta.discourse.org/t/403-error-on-message-bus/277637/2 "2023-09-03T15:08:32Z")

</div>

好的，我解决了这个问题！我将把它写在这里。也许将来有人会遇到同样的问题：

我正在使用 BunkerWeb，它在其后端应用程序之一中使用了 Modsecurity。Apparently，该 Modsecurity 核心集规则将消息总线 POST 请求视为 SQL 注入攻击。

```plaintext
ModSecurity: Warning. Matched \"Operator `Rx' with parameter `(?i:(?:^[\\W\\d]+\\s*?(?:(?:alter\\s*(?:a(?:(?:pplication\\s*rol|ggregat)e|s(?:ymmetric\\s*ke|sembl)y|u(?:thorization|dit)|vailability\\s*group)|c(?:r(?:yptographic\\s*provider|edential)|o(?:l(?:latio|um)|nve (1040 个字符已省略)' against variable `ARGS_NAMES:/delete' (Value: `/delete' ) [file \"/usr/share/bunkerweb/core/modsecurity/files/coreruleset/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf\"] [line \"426\"] [id \"942360\"] [rev \"\"] [msg \"Detects concatenated basic SQL injection and SQLLFI attempts\"] [data \"Matched Data: /delete found within ARGS_NAMES:/delete: /delete\"] [severity \"2\"] [ver \"OWASP_CRS/3.3.4\"] [maturity \"0\"] [accuracy \"0\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-sqli\"] [tag \"paranoia-level/1\"] [tag \"OWASP_CRS\"] [tag \"capec/1000/152/248/66\"] [tag \"PCI/6.5.2\"]

```

我像这样添加了一个 ModSec 规则排除项：

```plaintext
SecAction "id:10000,phase:1,nolog,pass,t:none,ctl:ruleRemoveById=942360

```

问题解决了！我知道这可能对大多数人没有帮助，但正如我所说，也许它能帮到某人。干杯！

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023年十月3日 15:08 UTC](https://meta.discourse.org/t/403-error-on-message-bus/277637/3 "2023-10-03T15:08:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
