Skip to content
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

libmmkv.so未使用堆栈保护 #1472

Open
buptstone opened this issue Jan 15, 2025 · 1 comment
Open

libmmkv.so未使用堆栈保护 #1472

buptstone opened this issue Jan 15, 2025 · 1 comment

Comments

@buptstone
Copy link

鸿蒙的mmkv使用的1.3.5版本,有个安全问题:

Harmony-堆栈保护(不安全)
漏洞描述:
编译程序时采用Stack Smashing Protector (SSP)选项,能够防止栈溢出等破坏性攻击。
漏洞证明:
以下so未使用堆栈保护:
entry\libs\x86_64\libc++shared.so
entry\libs\x86_64\libmmkv.so
entry\libs\x86_64\libnativeGpu.so

修复建议:
使用 -fstack-protector(简称 SSP,Stack Smashing Protector)编译选项有助于防止缓冲区溢出攻击,通过在栈帧中插入随机数("canary" 值)来检测堆栈溢出。例如将这些选项添加到makefile中:
CFLAGS += -fstack-protector

@lingol
Copy link
Collaborator

lingol commented Jan 15, 2025

I don't think it is a mandate to add the stack protector for OHOS native libs. Can you provide the official requirement from HuaWei that requires all OHPM lib or Hap to turn on SSP?

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