-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atlassian Jira fails in Theia Blueprint #13087
Comments
It actually loads a few JS bundles that are supposed to render something to the webview. But they seem to error out with some obfuscated/minified error: Doesn't seem to be an issue with Theia, but rather something that the extension is doing wrong when running in Theia. The extension code is open source, so one could build a non-minified version to debug the issue: https://bitbucket.org/atlassianlabs/atlascode/src/main/ |
@msujew I tried your suggestion. I cloned the Bitbucket repo and was able to build and debug it in VS Code. But when I attempted the same in Theia (Theia Blueprint) I was able to build it, but extension initialization failed with instructions to check the debug log, which was empty. |
@msujew, I can have a look. Can you assign me the task? |
#12371 may be potentially related? |
I could reproduce the error from a local build version. While trying to configure the settings, the setting page shows up, and then goes blank. The console is spammed with these messages:
The InlineTextEditorList comes from atlassian library (guipi core components) and is used in several places. I could not investigate further to understand why the extensions works fine in vscode and not in theia. I could still create new tasks on Jira and access their information from the extension in Theia, but this setting page has to be fixed in order to proper use the tool. Zipped vsix: atlascode-3.1.0.zip |
@tsmaeder @rschnekenbu :I further investigated this issue To break it further down, The root cause for this is that the inspect result is not the same on a prototype level. In Theia, certain object properties of the result, e.g., I tested a temporary fix in the atlascode extension by preprocessing the inspection result before merging and converting all nested properties into "real" objects again. This seems to fix the issue, and the settings page is rendered again. Nevertheless, we should further investigate why the behavior in Theia. regarding It seems like some |
The mitigation of prototype pollution does not work anyway: the attack vector we're trying to prevent are workspace settings. However, settings files are processed in the front-end (preference-provider.ts, etc.) and the resulting structures then sent to the plugin host process. At this time, the prototype injection will have already worked on the browser side, in which case the evil properties like |
@tortmayr I replaced the code that uses |
@tsmaeder I did test this by tweaking the public flattenedConfigForTarget(target: ConfigTarget): FlattenedConfig {
const inspect = this.convertToPrototypeObject(configuration.inspect<IConfig>());
//...
}
convertToPrototypeObject(obj: any): any {
// Base case: if it's not an object or it's null, return it directly
if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
return obj;
}
// Create a new object that inherits from Object.prototype
const newObj = {};
// Recursively process each property of the object
for (const key of Object.keys(obj)) {
newObj[key] = this.convertToPrototypeObject(obj[key]);
}
return newObj;
} With that change the settings page renders as expected in Theia: You can find the vsix+source code here: So I guess, we are still missing some |
I guess the problem is ultimately that our code in |
In the end, the answer why this works in VS Code is surprisingly simple: in |
Fixes eclipse-theia#13087 Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder <[email protected]>
Fixes #13087 Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder <[email protected]>
Thanks, confirmed this works now |
Atlassian Jira extension is available on open-vsx.org, https://open-vsx.org/extension/atlassian/atlascode. It is up to date with the Visual Studio Marketplace, 3.0.7. I can install and use it in Visual Studio (1.84.2 on OSX). When I attempt to do so in Theia Blueprint (1.43.0.128) the settings page renders blank. When you click the 'Please login to Jira' link in the upper left, the settings open for Jira instance credentials.
Visual Studio:
Theia Blueprint:
The text was updated successfully, but these errors were encountered: