Skip to content

检查请求中未定义的字段 #1

Description

@gwind

示例,如果多了一个未定义的 abc 字段,下面请求也能通过:

curl -X POST {URL} \
  -H 'Content-Type: application/json' \
  -d '{
	"abc": 123,
	"username": "ooclab",
	"password": "aaaaaa"
}'

除了风险之外,也带来了额外工作量,比如 BFF 层仅仅将 request body 转发到后端,是不能带未知字段的,就需要编码限制。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions