raincious
V2EX  ›  PHP

关于那个 Serialize 的 Bug,有人遇到过么?

  •  
  •   raincious · Jan 22, 2015 · 2562 views
    This topic created in 4177 days ago, the information mentioned may be changed or developed.
    帖子:
    https://www.v2ex.com/t/164074?p=2#r_1736883

    我在后面做了一点测试。结果是虽然PHP没有转义"':等字符,但是还是能正确转换并输出的。

    然后我又做了点测试:


    可能没做对导致Bug未触发?或者PHP已经修正了这个问题?有没有遭遇过这个Bug的朋友能给个能触发Bug的字符串?(伸手党)

    感谢。
    3 replies    2015-01-22 17:56:38 +08:00
    maddot
        1
    maddot  
       Jan 22, 2015
    maddot
        2
    maddot  
       Jan 22, 2015
    这个并不是serialize的bug
    raincious
        3
    raincious  
    OP
       Jan 22, 2015
    @maddot

    不,你上面的URL被我忽略了,因为说的问题是字符串编码和人造腐蚀的问题。(也就是我提到的数据破坏)。

    MySQL连接的时候是需要指定数据输入和链接传输字符集的,这两个字符集都必须正确,因为这是保证程序正常运行的条件之一。如果设置不正确的话,恐怕就不只有serialize会出问题了(都能注入了亲)。

    如果真是这样那还真虚惊一场……你……赔我的辣条……
    https://gist.github.com/raincious/01c0b5f11e8adc61bb4b
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1132 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:16 · PVG 02:16 · LAX 11:16 · JFK 14:16
    ♥ Do have faith in what you're doing.