99designs / 99designs/gqlgen

Lack of protection against CSRF attacks

未关闭
#3,248 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
10.8k
派生
1.3k
平均合并
2 天 36 分钟
30 天内合并 PR
26

描述

Hi,

The content-type "multipart/form-data" is enabled by default for POST requests, besides application/json.

I don't want to disable it because I am using it for file uploads.

This is now a security issue, as this makes the API vulnerable to CSRF requests by changing the content type of queries.
See [https://owasp.org/www-community/attacks/csrf] for more information.

Is there a way to enable other content types besides application/JSON for specific actions like file upload?

Is there a plan to implement CSRF tokens?

I've attached an example (change the IP address to yours in the HTML):

```

GQLGen CSRF PoC


history.pushState('', '', '/');





```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。