Skip to content

[对数据安全的疑问] 这样做是不是就能直接拿到整个库所有数据了? #814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wf120521 opened this issue Apr 23, 2025 · 1 comment

Comments

@wf120521
Copy link

Description

如果是一个懂APIJSON语法的人是可以通过语法分析出来数据库表关系的,这样直接把数据库的前100页内容扒光呢?这种有防止手段吗?从语法来看表关系的暴露应该是避免不了,那字段上的有什么好的屏蔽方式吗?我感觉默认就把所有字段查出来是不是不太安全?或者稍微安全点的操作,比如:每个Table必须指定@column

@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 26, 2025

APIJSON 在传参、权限、防 SQL 注入、表名和字段名映射、请求映射 等方面的多重全面严格安全校验机制早就通过了腾讯内部严格的安全评估,
各大厂商各种场景的多年实际使用案例也证明了 APIJSON 的高度安全性和可靠性,甚至连华能贵诚信托、投投科技这种金融公司都用了 APIJSON。
#12
https://github.com/APIJSON/apijson-column
https://github.com/APIJSON/apijson-router

只要不是后端权限等配置不当或业务代码有安全问题,就不会意外地通过 APIJSON 的接口泄漏数据。
如果配置不当或者业务代码有安全问题,或者泄漏了数据库的 URI 及账号密码,
那不管用不用 APIJSON、还是用什么其它技术都会出现这种安全问题。

对有权限的合法用户,确实可以查到可控范围和数量的数据,
例如默认配置 Parser 的 getMaxQueryCount 和 getMaxQueryPage 都是 100:
在 AbstractParser.IS_START_FROM_1 = false 时能最多查到 100*101 = 10100 条数据;
在 AbstractParser.IS_START_FROM_1 = true 时能最多查到 100*100 = 10000 条数据。

这个本来就是业务需要的,你就算不登录也能从 Google、百度 等网站查到最多 50 页数据,难道是因为安全问题泄漏了数据给你?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants