while ( true ) { if ( this . ch <= '/' ) { if ( this . ch == '' | | this . ch == '\r' | | this . ch == '\n' | | this . ch == '\t' | | this . ch == '\f' | | this . ch == '\b' ) { this . next ( ) ; continue ; if ( this . ch == '/' ) { this . skipComment ( ) ; continue ; return ;

不难看出默认会去除键、值外的空格、\b、\n、\r、\f等,作为开胃菜

fastjson 1.2.68 最新版本有限制 autotype bypass 1.2.68加入了一个safeMode功能,默认未开启,需要用户手动开启。以下利用在默认未开启情况下可利用。 修复方法: ParserConfig.getGlobalInstance().setSafeMode(true); <!-- test for fastjson 1.2.68 autotype bypass --> <dependency>
fastjson ——分享 fastjson 的功能就是将json格式转换为类、 字符 串等供下一步代码的调用,或者将类、 字符 串等数据转换成json数据进行传输,有点类似序列化的操作; FastJson 利用 toJSONString 方法来序列化对象,而反序列化还原回 Object 的方法,主要的API有两个,分别是 JSON.parseObject 和 JSON.parse ,最主要的区别就是前者返回的是 JSONObject 而后者返回的是实际类型的对象,当在没有对应类的定义的情况下,通常情况下都会使