Security vulnerabilities requiring script right

Hi everyone,

script right grants many privileges, it is expected that a user with script right can execute JavaScript code in the session of another user, thereby being able to execute any action in that user’s name which could involve gaining programming right. For this reason, it doesn’t seem justified to consider a security issue that involves an attacker with script right as a real security issue.

I therefore propose that we:

  • publish all existing vulnerabilities that clearly require script right to be exploited
  • stop publishing CVEs for such issues

This doesn’t mean we won’t fix such issues, it just means they will be treated as regular bugs and not as security issues. The aim of this is to reduce the load on the developers to manage and fix such issues. As reporters will be able to see existing issues, we expect fewer duplicates or at least easier handling, more people can help to fix the issues and less work is required beyond the actual fix. As we currently consider security vulnerabilities that involve script right as low-priority security issues, this could actually make it more likely that privilege escalation bugs in scripting APIs get fixed as they could become actual quick fixes instead of requiring the complicated handling of a security vulnerability.

I’m a bit undecided if what I wrote above should only apply to:

  • security issues that involve another user (or affect stability)
  • security issues that actually involve scripting (and not, e.g., a REST API that allows a subwiki admin to change the main wiki owner)

There also needs to be a broader discussion what protections script right should provide. I personally don’t see any use in trying to make script right fully secure - it is a huge effort, and I don’t think it is possible with the development capacities we have.

I think it makes sense to have script right as a way to make it easier to write code that respects the rights of the current user without always having to think about right checks, but I don’t see any possibility to have a real barrier between script and programming right without introducing extremely complex, limiting, slow and error-prone workarounds, like isolating scripts of different users in different iframes, which would make it so much more complicated to both design frameworks for them and write the actual scripts.

Instead of trying to spend resources on securing script right, I think we need to strengthen what’s possible without script right, and work towards:

  • making it possible to create customizations like panels, sheets, and whole AWM applications without having script right (not everything in the application might be modifiable directly in that case) - maybe not for every user, but maybe with extra, dedicated rights.
  • roles that grant administration/right management access without granting script right, and making more and more features available to such roles without granting script right.

Ultimately, I think it should be possible to have an XWiki installation where no actual user has script right, code only comes from trusted, signed extensions, but the wiki can still be customized in many ways without writing code. My idea is not that you cannot write code in XWiki anymore, but that you would do that more in a development instance and then deploy that code as a signed extension into your production system, where the code can, e.g., be used as a wiki macro.

So to summarize, I think we should:

  • accept that script right is insecure
  • work on making it easier to use XWiki without script right

I’m opening this first as a proposal to gather opinions in particular regarding how broad we should define the rule. I think for the actual rule change, we should have a proper vote.

PS: this post is intentionally public to allow broad participation in the discussion, the fact that script right is dangerous was already publicly documented before at https://dev.xwiki.org/xwiki/bin/view/Community/Security/#HScriptRight so I don’t think this post discloses anything new - make sure you don’t discuss any currently private security issue here.

+1

Thanks,
Marius

I’m still reluctant to go there, but I know you are probably right on this.

There is also the fact that those issues are not going to be fixed anything soon with the current priority structure, and they are already easy to find anyway with LLMs, making them close to public, but without a strong enough warning about the script feature.

Big +1 for that in any case. I think there are many things that can be done to reduce the need to use the script macro for quite common use cases. This would be much better for most users and much easier to make safe.

I agree with this summary, but not necessarily with the call for actions, in particular:

I’m not so sure about that. At the very least it shouldn’t be something blindly done: we should review each of them individually to ensure it’s not hiding something else etc.

To be discussed, I’m not against it.