Bug Report:
Environment: onlyoffice/documentserver:9.4 (Docker), embedded DocsAPI.DocEditor
Issue: According to the Security FAQ, when JWT is enabled the clear-text config should be ignored in favor of the signed JWT payload. However, certain fields (e.g. editorConfig.user.name) are still read from the clear-text config instead of the JWT token – allowing a client to manipulate editor behavior despite JWT enforcement being active.
Otherwise, the integration works correctly – documents load and save without any issues. The JWT token is apparently being validated, as mismatched or invalid signatures correctly result in errors.
Config (test environment – JWT can be checked in https://www.jwt.io/ with secret secretsecretsecretsecretsecretsecret): Note that the clear-text config intentionally contains a different value for editorConfig.user.name than the one signed in the JWT token.
config = {
"document" : {
"fileType" : "docx",
"key" : "19e6ffc3548-e5c9eb5a-7883-4630-b49c-5bee5620c0f2",
"title" : "/docs/test1",
"url" : "http://host.docker.internal:8081/designer/api/documents/load/19e6ffc3548-e5c9eb5a-7883-4630-b49c-5bee5620c0f2",
"permissions" : {
"edit" : true,
"review" : true,
"download" : false,
"print" : false,
"copy" : false,
"fillForms" : true,
"modifyFilter" : false,
"modifyContentControl" : false
}
},
"editorConfig" : {
"callbackUrl" : "http://host.docker.internal:8081/designer/api/documents/save",
"lang" : "en",
"mode" : "edit",
"customization" : {
"forcesave" : true,
"autosave" : true,
"trackChanges" : true,
"chat" : false,
"comments" : false,
"compactToolbar" : false,
"hideRightMenu" : true,
"uiTheme" : "theme-light"
},
"user" : {
"id" : "USER-D5AF2B02-3051-4506-B1DF-7CEDC3D9E6E2",
"name" : "Developer user CHANGED"
}
},
"documentType" : "word",
"token" : "eyJhbGciOiJIUzI1NiJ9.eyJkb2N1bWVudCI6eyJmaWxlVHlwZSI6ImRvY3giLCJrZXkiOiIxOWU2ZmZjMzU0OC1lNWM5ZWI1YS03ODgzLTQ2MzAtYjQ5Yy01YmVlNTYyMGMwZjIiLCJ0aXRsZSI6Ii9kb2NzL3Rlc3QxIiwidXJsIjoiaHR0cDovL2hvc3QuZG9ja2VyLmludGVybmFsOjgwODEvZGVzaWduZXIvYXBpL2RvY3VtZW50cy9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