We have a plugin in jira using osworkflow to define our own custom workflow. Our plugin works within jira and when i try to initialize workflow, We are getting this error in jira.log.
Caesium-1-3 ERROR ServiceRunner
[c.a.jira.workflow.DefaultOSWorkflowConfigurator] Rejecting usage of unsafe workflow function/class: com.service.workflow.condition.PermissionCondition . You can enable usage of this class by adding com.atlassian.jira.security.LegacyJiraTypeResolver.WARN_ONLY.enabled dark feature flag to Jira. Do it only if you are sure its known and secure case. It will make Jira vulnerablefor potential attacks.
and we are getting below exception
[INFO] [talledLocalContainer] com.opensymphony.workflow.WorkflowException: Could not load condition [INFO] [talledLocalContainer] at com.opensymphony.workflow.AbstractWorkflow.passesCondition(AbstractWorkflow.java:1045) [INFO] [talledLocalContainer] at com.opensymphony.workflow.AbstractWorkflow.passesConditions(AbstractWorkflow.java:1083) [INFO] [talledLocalContainer] at com.opensymphony.workflow.AbstractWorkflow.passesConditions(AbstractWorkflow.java:1107) [INFO] [talledLocalContainer] at com.opensymphony.workflow.AbstractWorkflow.canInitialize(AbstractWorkflow.java:862) [INFO] [talledLocalContainer] at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:598)
It was working for all versions of jira prior to jira 8.18.0 and failing on 8.18.x. Is there any specific change related to this in jira 8.18.0 ?
Also when I add com.atlassian.jira.security.LegacyJiraTypeResolver.WARN_ONLY.enabled dark feature flag to Jira. It works !! Is it possible to achieve this by making changes in code so customer don’t need to enable this dark feature?
In response to your latter question, we strongly recommend not changing the instance’s configuration on the customer’s behalf. Please keep in mind that turning on the flag reintroduces the security vulnerability and is exposing instances to remote code execution.
One of the solutions for your current situation could be implementing an UI change notifying the instance administrators about a given problem, its root cause, and steps that would have to be taken to make the plugin operational.
Please, don’t hesitate to reach out to us again in case of further questions.
This is a case of usages of osworkflow outside of Jira internal usages. Received reply from engg team. Suggested below 2 approaches which actually worked for us.
export com.apps.service.workflow.condition.PermissionCondition as workflow module
Hi @mmarzecki ,
we are again getting the following error when we try to use osworkflow on Jira 9.17.0
2024-07-02 11:52:32,266+0000 http-nio-8080-exec-7 ERROR admin 712x106889x1 stntdz 112.133.217.119,127.0.0.1 /rest/upraisesuccess/latest/distributions/757/addUser [c.a.jira.workflow.DefaultOSWorkflowConfigurator] Rejecting usage of unsafe workflow function/class: `com.amoeboids.apps.service.workflow.condition.PermissionCondition`. You can enable usage of this class by adding `com.atlassian.jira.security.LegacyJiraTypeResolver.WARN_ONLY.enabled` dark feature flag to Jira. Do it only if you are sure its known and secure case. It will make Jira vulnerablefor potential attacks.
2024-07-02 11:52:32,272+0000 http-nio-8080-exec-7 ERROR admin 712x106889x1 stntdz 112.133.217.119,127.0.0.1 /rest/upraisesuccess/latest/distributions/757/addUser [c.a.a.service.impl.DistributionServiceImpl] error
com.opensymphony.workflow.WorkflowException: Could not load condition
at com.opensymphony.workflow.AbstractWorkflow.passesCondition(AbstractWorkflow.java:1045)
at com.opensymphony.workflow.AbstractWorkflow.passesConditions(AbstractWorkflow.java:1083)
at com.opensymphony.workflow.AbstractWorkflow.passesConditions(AbstractWorkflow.java:1107)
at com.opensymphony.workflow.AbstractWorkflow.canInitialize(AbstractWorkflow.java:862)
at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:598)
at com.amoeboids.apps.service.impl.DistributionServiceImpl.createWorkflowEntries(DistributionServiceImpl.java:455)
at com.amoeboids.apps.service.impl.DistributionServiceImpl.addDistributionUser(DistributionServiceImpl.java:1092)
at com.amoeboids.apps.rest.v1.distribution.DistributionResource.addDistributionUser(DistributionResource.java:656)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
... 19 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:171)
... 1 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:75)
... 32 filtered
at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
... 8 filtered
at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:59)
... 4 filtered
at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
... 3 filtered
at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:54)
... 8 filtered
at com.miniorange.rest.auth.filter.MoUserRestrictionFilter.doFilter(MoUserRestrictionFilter.java:57)
... 3 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
... 43 filtered
at com.atlassian.oauth2.scopes.web.ReadWriteScopeFilter.doFilter(ReadWriteScopeFilter.java:46)
... 3 filtered
at com.atlassian.plugins.slack.analytics.SlackAnalyticsFilter.doFilter(SlackAnalyticsFilter.java:35)
... 3 filtered
at com.atlassian.ratelimiting.internal.filter.RateLimitFilter.doFilter(RateLimitFilter.java:73)
... 3 filtered
at com.atlassian.troubleshooting.thready.filter.AbstractThreadNamingFilter.doFilter(AbstractThreadNamingFilter.java:46)
... 17 filtered
at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
... 1 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
... 16 filtered
at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:38)
... 3 filtered
at com.atlassian.pats.web.filter.TokenBasedAuthenticationFilter.doFilter(TokenBasedAuthenticationFilter.java:82)
... 3 filtered
at com.atlassian.oauth2.provider.core.web.AccessTokenFilter.doFilter(AccessTokenFilter.java:81)
... 19 filtered
at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
... 5 filtered
at com.atlassian.plugins.authentication.impl.basicauth.filter.DisableBasicAuthFilter.doFilter(DisableBasicAuthFilter.java:70)
... 3 filtered
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:220)
at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136)
at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:211)
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:139)
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:128)
... 4 filtered
at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
... 8 filtered
at com.miniorange.rest.auth.filter.MoRestAPIFilter.doFilter(MoRestAPIFilter.java:97)
... 3 filtered
at com.atlassian.ratelimiting.internal.filter.RateLimitPreAuthFilter.doFilter(RateLimitPreAuthFilter.java:71)
... 3 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
... 4 filtered
at com.atlassian.troubleshooting.thready.filter.AbstractThreadNamingFilter.doFilter(AbstractThreadNamingFilter.java:46)
... 3 filtered
at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
... 26 filtered
at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
... 25 filtered
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Unknown Source)
Earlier also we were getting the same error when we tried to use osworkflow on Jira 8.18.0. At that time we fixed this issue by adding the workflow classes in our atlassian-plugin.xml file. It fixed the issue at that time for us.
But now we are gain getting the same error for Jira 9.17.0.
Last time we did the following change in our atlassian-plugin.xml