程序员服装安全 OWASP 十大 API 系列-大规格模任务业务

大规格模分配漏之所以,这是因为许多现代的方框鼓鼓鼓鼓鼓起开发人员使用自动将来自客户端的输入绑定到代码变量和内部对象的函数。这样做是为了简化代码和加快操作制作而成。
攻击者可以使用这种方法法强制改永远不该由客户端更新新的对象属性。通常,这会导致特定业务的问题,例如用户向自己的添加管理人员权限限制,而不是关闭网站或取消公司机密信息。攻击者还必须与他们正处于利用的应用程序的业务逻辑之下的关系所在。
但的确,这些都不会降低低大规格模组在聪明而恶意的用户手中的危险。
在我们发布完整指南之前,先玩一下我们的游戏化之战,看看你的表演如何:
攻击者如何利用批量分配漏洞?
OWASP 提示的场景(并由我们稍后工作修改)假设一个使用批量赋值绑定值绑定到代代中码对象的不同同属性,该应用程序包包含绑定到代码中对象的不同同属性,该应用程序包含绑定到代码中对象的不同同属性。其中包括:用户可以更新的权限限制相关属性的权限以及只允许应用程序内部设置的流程相关属性。两者都使用批量赋值将属性的绑定到对对象。
在这种情况下,车载应用程序允许用户更新自己的个人资料,这在许多面向用户的应用程序中很常见。这是使用发送 API 调用完成后,该调用返回以下 JSON 对对象:
{“名称”: “SneakySnake”,“年龄”: 17,“is_admin”: false}
由于攻击者,本例中为 SneakySnake 先生,已重启了其属性和对象之间的关系,因而他可以使用以下重发发送更新的个人资料的原因所在:
{“名称”: “SneakySnake”,“年龄”: 24,,“is_admin”: true}
由于端点容我受到了批量分配的影响,因为它接收到新输入为有效输入。我们的黑客不只是在他的个人资料中增添了几年,而且而且还为自己配了管理人员权限的极限。
消除批量分配漏洞
尽量管在某些框架架构中使用批量分配 FUNCTURNAMUCABLE 可能很方便,但你想保持 API 的安全,则应避免这样做。相反,解析请求值,而不是将它们直接绑定到对对象。您还可以使用简化的数据传输对象,该对象提供的便利性与直接接入绑定到对比本身几乎是相似的,只是没有相关性。
作为额外的预防措施,绝对可以拒绝诸如上例中的管理者权利限制之类的敏感属性,这样的服务器将永远不会在 API 调用中接受。更好主意可能是在默认情况下拒绝所有属性,然后允许你希望的用户能够更新新或更改进特定、非敏感的属性。做这些任何事情,都有助手锁定 API 并消除环境中的大规模。
来看看 安全代码勇士 博客页面,详细了解此漏洞,以及如何保护您的和客户免受其他安全漏洞的破坏损坏。你也可以 试试演示提示 Secure Code Warrior 培训平台可让您的所有网络安全技能不间断地进行练习并保持最新状态。
Govern AI-driven development before it ships
Measure AI-assisted risk, enforce secure coding policy at commit, and accelerate secure delivery across your SDLC.
Explore more blogs
Lorem Issum diam quis eim leboutis ein selerisque lobortis sepitis beelrisque lobortis sepitis celerisque lobortis celeriskue filmentis celeriskue filmentis celeriskue diam
%252520%252520(3).avif)
Supercharged Security Awareness: How Tournaments are Inspiring Developers at Erste Group
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Security as culture: How Blue Prism cultivates world-class secure developers
Learn how Blue Prism, the global leader in intelligent automation for the enterprise, used Secure Code Warrior's agile learning platform to create a security-first culture with their developers, achieve their business goals, and ship secure code at speed

One Culture of Security: How Sage built their security champions program with agile secure code learning
Discover how Sage enhanced security with a flexible, relationship-focused approach, creating 200+ security champions and achieving measurable risk reduction.
Secure AI-driven development before it ships
See developer risk, enforce policy, and prevent vulnerabilities across your software development lifecycle.


