| CARVIEW |
Select Language
HTTP/2 200
date: Thu, 25 Dec 2025 21:02:40 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"8ca7bfa9187b78889f68fa989effe367"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=j8ey4ikQgatMwd4jfd9s%2FW9yhsxaabZkxCkJ09eHquDspAws5Of%2BbhIwsL9A6tf6SUo%2FkMo8CmDjfAPVFFosL6cnf6lBLMoXnkrkXBgb4DHSMqbY1EImT1uSOG3aaOUSAW0vMqW2RpIODXzaqwmm0%2BrrGYn0vYirY1CneClKg2%2F6r6ta0xr2AUqm46vETQqxmsHfDIsfTcnmgUulQNAoe%2BL9bgeU0GwsfPizhkGGlPGWzMuctcGnSun9%2BnW6w1hGxV9exWmCMLJLVp2xxWL0JQ%3D%3D--SuD1Snn0T9mY569S--0RNzOPXiBH0SkNe9VSfGLw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1011631792.1766696559; Path=/; Domain=github.com; Expires=Fri, 25 Dec 2026 21:02:39 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 25 Dec 2026 21:02:39 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E562:21D903:2F74556:38B69D2:694DA66F
enable_autotype · alibaba/fastjson Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
enable_autotype
温绍锦 edited this page Jan 13, 2021
·
12 revisions
在1.2.25之后的版本,以及所有的.sec01后缀版本中,autotype功能是受限的,和之前的版本不同,如果在升级的过程中遇到问题,可以通过以下方法配置。
- 注意:如果配置了safeMode,配置白名单也是不起作用的。
添加白名单有三种方式,三选一,如下:
ParserConfig.getGlobalInstance().addAccept("com.taobao.pac.client.sdk.dataobject."); 如果有多个包名前缀,分多次addAccept
-Dfastjson.parser.autoTypeAccept=com.taobao.pac.client.sdk.dataobject.,com.cainiao.
如果有多个包名前缀,用逗号隔开
在1.2.25/1.2.26版本支持通过类路径的fastjson.properties文件来配置,配置方式如下:
fastjson.parser.autoTypeAccept=com.taobao.pac.client.sdk.dataobject.,com.cainiao. // 如果有多个包名前缀,用逗号隔开
如果通过配置白名单解决不了问题,可以选择继续打开autotype功能,fastjson在新版本中内置了多重防护,但是还是可能会存在一定风险。两种方法打开autotype,二选一,如下:
-Dfastjson.parser.autoTypeSupport=true
ParserConfig.getGlobalInstance().setAutoTypeSupport(true); 如果有使用非全局ParserConfig则用另外调用setAutoTypeSupport(true);
打开AutoType之后,是基于内置黑名单来实现安全的,但黑名单是穷举不完的,如果发现了新的风险类,可以通过以下配置来增加黑名单:
-Dfastjson.parser.deny=xx.xxx
- 这里的xx.xxx是包名前缀,如果有多个包名前缀,用逗号隔开
在1.2.25之后的版本支持通过类路径的fastjson.properties文件来配置,配置方式如下:
-Dfastjson.parser.deny=xx.xxx
- 这里的xx.xxx是包名前缀,如果有多个包名前缀,用逗号隔开
ParserConfig.getGlobalInstance().addDeny("xx.xxx");- 这里的xx.xxx是包名前缀,如果有多个包名前缀,用逗号隔开
如有需要修改本注脚,请联系阿里巴巴,
© Alibaba Fastjson Develop Team
注明: 版权所有阿里巴巴,请注明版权所有者
If you need to amend this footnote, please contact Alibaba.
© Alibaba Fastjson Develop Team
Note: Copyright Alibaba, please indicate the copyright owner
Clone this wiki locally
You can’t perform that action at this time.