# Help with security vulnerability in Forge app

**URL:** <https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751>\
**Category:** Forge\
**Tags:** ecosystem-security, marketplace, forge\
**Created:** [January 27, 2023, 1:34pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751 "2023-01-27T13:34:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![LouisPhilippeCarigna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/louisphilippecarigna/32/44403_2.png) [@LouisPhilippeCarigna](https://community.developer.atlassian.com/u/LouisPhilippeCarigna)\
**Post date:** [January 27, 2023, 1:34pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/1 "2023-01-27T13:34:03Z")

</div>

Hi,

I got a list of security vulnerabilities from The EcoScanner check 3 weeks ago on my Atlassian app.

They all said the same message, which is:

```auto
Vulnerability Description
The EcoScanner check, Custom-Check-Authorization-<unique id here>, for FSRT has reported the following issue:

Authorization bypass detected through handler.<methodName> in "/tmp/forge-app/src/index.js".

The check provided the following proof:

Unauthorized API call via asApp() found via handler.<methodName>

Mitigation Recommendation
The following resource was provided as a remediation recommendation:

Use the authorize API https://developer.atlassian.com/platform/forge/runtime-reference/authorize-api/ or manually authorize the user via the product REST APIs.

```

I got around to addressing those vulnerabilities this week.

My understanding was that I’m using **asApp** instead of **asUser** so I changed all of my calls to **asUser**.

For example, here’s an example of a call to the Jira REST API that I do in my Atlassian app. I replaced asApp to asUser.

```auto
const response = await api
        .asUser()
        .requestJira(
            route(`/rest/api/3/search`), {
            method: "POST",
            headers: {
                accept: "application/json",
                "content-type": "application/json",
            },
            body: JSON.stringify(data)
        });

```

I pushed a version to development and staging to get a green light from the bot. It returned the same vulnerability check so I figured I would push my changes to production.

I pushed my changes to production but still go a response from the EcoScanner bot telling me the same message as above.

I’m stumped. I don’t know what to change.

I’ve looked at the [Authorize API](https://developer.atlassian.com/platform/forge/runtime-reference/authorize-api/) but my calls in the handler file named above are on reading boards, statuses, and doing JQL queries through the Jira REST API. The methods in the Authorize API do not allow me to do these kinds of checks.

Does any know how to fix this problem? What did I forget? Is my issue related to my manifest.yml file instead? Or is there an alternate solution I didn’t see?

Any help or guidance would be appreciated,

Louis-Philippe

---

<div class="post-metadata">

**Author:** ![ppasler](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/ppasler/32/49174_2.png) [@ppasler](https://community.developer.atlassian.com/u/ppasler)\
**Post date:** [January 27, 2023, 6:30pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/2 "2023-01-27T18:30:43Z")

</div>

From my experience the bot is kind of lazy and the check is not successful immediately. I believe Atlassian does the final check by hand. You may add a comment in the AMS ticket and wait for an answer.

---

<div class="post-metadata">

**Author:** ![VakalosMixalis](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/vakalosmixalis/32/42011_2.png) [@VakalosMixalis](https://community.developer.atlassian.com/u/VakalosMixalis)\
**Post date:** [January 30, 2023, 12:08pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/4 "2023-01-30T12:08:06Z")

</div>

Hello,

We have the same issue, did you come up with any solution for this?

Thanks,

Mixalis

---

<div class="post-metadata">

**Author:** ![chhantyal](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/chhantyal/32/47298_2.png) [@chhantyal](https://community.developer.atlassian.com/u/chhantyal)\
**Post date:** [January 30, 2023, 12:15pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/5 "2023-01-30T12:15:17Z")

</div>

There is already another thread here [Forge custom fields with authorize in Forge app - which permission to use](https://community.developer.atlassian.com/t/forge-custom-fields-with-authorize-in-forge-app-which-permission-to-use/64618)

I am also waiting for comment from Atlassian, either here or in AMS ticket. I have no idea why they set SLA of a month and completely ignore here in the community as well as in the ticket.

---

<div class="post-metadata">

**Author:** ![LouisPhilippeCarigna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/louisphilippecarigna/32/44403_2.png) [@LouisPhilippeCarigna](https://community.developer.atlassian.com/u/LouisPhilippeCarigna)\
**Post date:** [January 30, 2023, 1:53pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/6 "2023-01-30T13:53:25Z")

</div>

Hi,

Following @ppasler comment above, I got a reply directly in my ticket telling me the bot was lazy. The person who commented in my ticket didn’t seem too worried about my issue.

Louis-Philippe

---

<div class="post-metadata">

**Author:** ![JoshuaWong](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JoshuaWong](https://community.developer.atlassian.com/u/JoshuaWong)\
**Post date:** [January 30, 2023, 9:25pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/7 "2023-01-30T21:25:17Z")

</div>

Hi,

Sorry about the delay. The scanner workflow currently runs daily, and it looks like your changes just missed the cutoff, which caused it to be run in the next batch. I agree that this can be confusing, because there could be a 24+ hour delay in the time that someone pushes a patch and the next scan job is run. As such, we’ll be increasing the cadence of our scanner workflow from now on, so that there’s less of a delay.

Also, note that we only scan artifacts that were deployed to the production environment. We apologize as we should have indicated this in the ticket description. We’ll be updating the ticket descriptions of our Forge scanners to clarify that only production app code is scanned.

As always, feel free to request an extension if you need additional time on the ticket.

Thanks,  
Joshua

---

<div class="post-metadata">

**Author:** ![LouisPhilippeCarigna](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/louisphilippecarigna/32/44403_2.png) [@LouisPhilippeCarigna](https://community.developer.atlassian.com/u/LouisPhilippeCarigna)\
**Post date:** [January 31, 2023, 1:35am UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/8 "2023-01-31T01:35:29Z")

</div>

Thank you so much for such a great answer 😀

---

<div class="post-metadata">

**Author:** ![chhantyal](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/chhantyal/32/47298_2.png) [@chhantyal](https://community.developer.atlassian.com/u/chhantyal)\
**Post date:** [January 31, 2023, 10:06am UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/9 "2023-01-31T10:06:34Z")

</div>

Hi @JoshuaWong thanks for joining the thread.

I am not sure if I understood it. Can we assume this security ticket as false flag? We have another similar thread [Forge custom fields with authorize in Forge app - which permission to use](https://community.developer.atlassian.com/t/forge-custom-fields-with-authorize-in-forge-app-which-permission-to-use/64618)

---

<div class="post-metadata">

**Author:** ![AboubacarSambare](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/aboubacarsambare/32/52283_2.png) [@AboubacarSambare](https://community.developer.atlassian.com/u/AboubacarSambare)\
**Post date:** [January 31, 2023, 2:06pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/10 "2023-01-31T14:06:42Z")

</div>

Hi @JoshuaWong  
We have the same security vulnerabilities issue raised by the ecoscanner in our case we are using these [endpoints](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-configuration--apps-/) where **jira permissions are not required for the Forge app that created the custom field**. we are unable to use **asUser** as by default jira user don’t have access to it.  
should we assume that is a false positive?

---

<div class="post-metadata">

**Author:** ![JoshuaWong](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@JoshuaWong](https://community.developer.atlassian.com/u/JoshuaWong)\
**Post date:** [January 31, 2023, 9:33pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/11 "2023-01-31T21:33:57Z")

</div>

Hi,  
Yeah we actually ran into this issue with a couple of other apps. The issue isn’t really with that endpoint itself, but that the invoking user may not have permission to view the underlying custom field(i.e. the custom field is only used in projects that the user does not have permission to view). One solution would be to make a call to [https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-get](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-get) with `asUser` to get the list of fields that the invoking user has permission to access and check if the supplied custom field is accessible to the user before making the other API calls.

I’ll ask around to see if there are any other ways to do this. Also, I’d like to emphasize that our main goal with these tickets is to work with Marketplace partners in resolving common security issues that can occur in apps. As such, if you had questions on your ticket that we were unable to get to for awhile or if you believe a patch would take longer than the provided SLA, please ask for an extension if you need one. It is our responsibility to ensure that partners have enough information needed to resolve these issues.

---

<div class="post-metadata">

**Author:** ![danielwester](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/danielwester/32/36730_2.png) [@danielwester](https://community.developer.atlassian.com/u/danielwester)\
**Post date:** [February 1, 2023, 4:55am UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/12 "2023-02-01T04:55:49Z")

</div>

Thank you Joshua for replying to the community.

> [@JoshuaWong](#):
>
> Also, I’d like to emphasize that our main goal with these tickets is to work with Marketplace partners in resolving common security issues that can occur in apps.

Unfortunately how these issues have been handled is yet another reason why I’m concerned that Atlassian isn’t ready to operate a platform with commercial apps. Can we get a proper SlE on the responses from Atlassian? I would expect it to be within 24 hours.

The excuse of “the scanner is lazy” or “the cronjob was broken” doesn’t really seem to fit for an enterprise security scanning solution imho. Once we push the fix - we need a signal back from the Atlassian asap or we have to assume that our fix is not valid.

/Daniel

---

<div class="post-metadata">

**Author:** ![ernst.stefan](https://avatars.discourse-cdn.com/v4/letter/e/7cd45c/32.png) [@ernst.stefan](https://community.developer.atlassian.com/u/ernst.stefan)\
**Post date:** [February 1, 2023, 9:43am UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/13 "2023-02-01T09:43:35Z")

</div>

Would this scanner flag every permission violation, even if intentional?

Because when I want to set entity properties on a project, I know the user is not authorized to do this unless he is the project admin. But if my app only sets a particular entity property, I don’t think it presents a security risk or should be flagged.

---

<div class="post-metadata">

**Author:** ![PredragTasevski](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@PredragTasevski](https://community.developer.atlassian.com/u/PredragTasevski)\
**Post date:** [February 20, 2023, 12:52pm UTC](https://community.developer.atlassian.com/t/help-with-security-vulnerability-in-forge-app/65751/14 "2023-02-20T12:52:03Z")

</div>

Thanks a lot. I can confirm that it is working, and the bot is accepting the patching solution.
