dqluw20882 2015-11-25 10:56
浏览 37

PHP UTF-8安全性:我必须在每个Inputdata上使用mb_check_encoding()作为安全原因吗?

Is mb_check_encoding() a must for secure PHP UTF-8 Apps?

Do I have to mandatorily use the function mb_check_encoding() on absolutely every input data, passed to a PHP UTF-8 Application to be "secure"?

Whatare the reasons/attack vectors?

Please give a short explain as to why this is important / what the attack vectors are. The mb_check_encoding() helps to protect against "Invalid Encoding Attack". But where in PHP could these become obvious/a security risk?

1.) If all data is outputted via htmlspecialschars() and I use prepared statements, is then the only remaining attack vector, that string comparisons might not match (comparing a valid with invalid UTF-8 for example in a security filter, where not matching might be problematic)? Or in the conrete example, would htmlspecialchars itself be vulnerable (if no correct UTF-8 is passend in) and would not encode the output, which of course would be a major security risk.

2.) Or are there worse complications comparable like buffer overflows, that allow directly hijacking the app?

3.) What further attack vectors/problems exist?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 linux驱动,linux应用,多线程
    • ¥20 我要一个分身加定位两个功能的安卓app
    • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
    • ¥15 IAR程序莫名变量多重定义
    • ¥15 (标签-UDP|关键词-client)
    • ¥15 关于库卡officelite无法与虚拟机通讯的问题
    • ¥15 目标检测项目无法读取视频
    • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
    • ¥100 求采集电商背景音乐的方法
    • ¥15 数学建模竞赛求指导帮助