CVE-2023-44384: Critical Vulnerability in Discourse-Jira Plugin Allows SSRF Attack and Unauthorized Access to Jira API

A severe security vulnerability (CVE-2023-44384) has been discovered in the Discourse-Jira plugin that enables attackers to perform a Server-Side Request Forgery (SSRF) attack and make unauthorized GET requests to the Jira API. Discourse-Jira is a popular plugin for Discourse, providing seamless integration with Jira projects. It automatically syncs Jira projects, issue types, fields, and field options.

Exploit Description

The vulnerability stems from two weaknesses in the plugin. First, the plugin allows an administrator user to set the Jira URL to an arbitrary location, resulting in an SSRF attack when combined with enabling the discourse_jira_verbose_log site setting. Second, a moderator user can manipulate the request path to the Jira API, enabling them to perform arbitrary GET requests using the Jira API credentials, potentially with elevated permissions, utilized by the application.

Code Snippet Illustrating Vulnerability

Here's a code snippet illustrating the vulnerability, showing the code block that sets the Jira URL to an arbitrary location:

# Discourse - Jira plugin - SSRF vulnerability example
jira_url = GlobalSetting.jira_url || SiteSetting.jira_site_setting
options = {
  baseUrl: "#{jira_url}/",
  # Other options...
}
client = JIRA::Client.new(options)

Server-Side Request Forgery (SSRF) Attack

The attacker can exploit the SSRF vulnerability by setting the Jira plugin's URL to any arbitrary URL, leading to potential data leaks and unauthorized access to protected resources. If the discourse_jira_verbose_log site setting is enabled, all HTTP requests and responses will be logged, potentially exposing sensitive information in logs.

Unauthorized GET Requests to the Jira API

The vulnerability enables the attacker to manipulate the request path to internal or only accessible Jira API endpoints. As such, they can use the Jira API credentials to perform unauthorized actions on the Jira environment and services.

Mitigation Measures

To mitigate this vulnerability, proper input validation should be implemented within the application's logic for both the Jira URL and request path settings. The plugin maintainer should also disable the discourse_jira_verbose_log site setting by default and enforce a least-privileged approach when dealing with Discourse permissions.

Before a patch is released, administrators can protect against this vulnerability by being cautious about which users are granted administrator and moderator statuses and keeping a close eye on user behavior.

Original References

1. Discourse-Jira Plugin GitHub Repository
2. Discourse Community Discussion on the Vulnerability

Conclusion

CVE-2023-44384 is a critical vulnerability in the Discourse-Jira plugin that can potentially lead to severe data leaks and unauthorized access to Jira API services. Administrators should be aware of this issue and take appropriate measures to mitigate the risk. Keep an eye on the development of this plugin, and make sure to update it as soon as a patch is released to address this vulnerability.

Timeline

Published on: 10/06/2023 18:15:12 UTC
Last modified on: 10/11/2023 17:49:49 UTC