asapp-privilege-escalation

asapp-privilege-escalation is a cursor rule for Cursor from atlassian/forge-skills. It costs 13 tokens per session (1,700 once invoked), scanned A, original, Apache-2.0.

A security rule for finding privilege-escalation risks in Atlassian Forge apps when code uses the app’s broader permissions without checking the requesting user’s rights. Privilege escalation means gaining access or abilities beyond those normally allowed.

In plain words
What is it for?
Use it to review resolver requests, web triggers, events, and agent actions that call APIs or change data through asApp(), especially when handling a specific resource.
Why use it?
It catches cases where a user-controlled request can trigger an operation with the app’s elevated permissions.

Cursor rule for Cursor ✓ vendor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to review resolver requests, web triggers, events, and agent actions that call APIs or change data through asApp(), especially when handling a specific resource.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/atlassian/forge-skills/asapp-privilege-escalation
About the project

Atlassian Forge Skills supports Atlassian Forge, a platform for building and deploying apps that extend products such as Jira and Confluence. Its skills and MCP-backed tools help coding agents create Forge apps, review them before deployment, optimize usage, troubleshoot failures, and work with Forge APIs and the Atlassian Design System.

atlassian/forge-skills · 35 stars · on GitHub · developer.atlassian.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/atlassian/forge-skills

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for asapp-privilege-escalation

README.md
[![agentmods](https://agentmods.dev/badge/rules/atlassian/forge-skills/asapp-privilege-escalation/github.svg)](https://agentmods.dev/rules/atlassian/forge-skills/asapp-privilege-escalation)
Your own site
<a href="https://agentmods.dev/rules/atlassian/forge-skills/asapp-privilege-escalation"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/asapp-privilege-escalation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for asapp-privilege-escalation

Your own site · 80×15
<a href="https://agentmods.dev/rules/atlassian/forge-skills/asapp-privilege-escalation"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/asapp-privilege-escalation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,700 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.01700
Opus 5.5 $0.00005 $0.00680
Sonnet 5.5 $0.00003 $0.00340
Haiku 4.5 $0.00001 $0.00170

Measured 20d ago against content hash 4a2e7c2535be, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

asapp-privilege-escalation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/forge-security-review/assets/security-rules/forge-authn-authz/asapp-privilege-escalation.mdc · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

  • asApp() operates with the app's full permissions, which typically exceed those of asUser(). This creates privilege escalation risks when asApp is used without verifying the requesting user has permission for the action.
  • For user-invoked actions, default to asUser() when possible. If asApp() is required, perform explicit permission verification for the same target resource before the asApp() sink.
  • Related CWE: CWE-269 (Improper Privilege Management), CWE-862 (Missing Authorization).

Scope & Signals

  • Sources: Resolver payloads, web trigger requests, event payloads, Rovo agent actions.
  • Sinks: api.asApp().requestJira(), api.asApp().requestConfluence(), api.asApp().requestBitbucket, api.asApp().requestGraph and other request types, storage mutations, any state-changing operations.
  • Red flags:
    • asApp() calls immediately after receiving payload without permission checks.
    • Authorization checks that are missing, generic, or not bound to the same resource ID used by the sink call.
    • Using asApp() for operations the requesting user couldn't perform directly and not checking user permissions.
    • Missing validation that the user owns or has access to the target resource.

Vulnerable Patterns

// VULNERABLE - user-controlled target reaches asApp sink with no authz check
resolver.define('updateIssue', async ({ payload }) => {
  await api.asApp().requestJira(route`/rest/api/3/issue/${payload.issueId}`, {
    method: 'PUT',
    body: JSON.stringify(payload.fields)
  });
});

// VULNERABLE - check is not coupled to the same resource used in asApp sink
resolver.define('transitionIssue', async ({ payload }) => {
  // Checks permission on payload.issueId ...
  const canEdit = await authorize().onJiraIssue(payload.issueId).canEdit();
  if (!canEdit) throw new Error('Forbidden');

  // ... but mutates payload.targetIssueId (attacker-controlled)
  await api.asApp().requestJira(route`/rest/api/3/issue/${payload.targetIssueId}/transitions`, {
    method: 'POST',
    body: JSON.stringify({ transition: { id: payload.transitionId } })
  });
});

Secure Patterns

// SECURE - prefer asUser when operation should respect caller permissions
resolver.define('updateIssueAsUser', async ({ payload }) => {
  return api.asUser().requestJira(route`/rest/api/3/issue/${payload.issueId}`, {
    method: 'PUT',
    body: JSON.stringify(payload.fields)
  });
});

// SECURE - asApp only after explicit permission check on same resource
resolver.define('updateIssueAsApp', async ({ payload }) => {
  const canEdit = await authorize().onJiraIssue(payload.issueId).canEdit();
  if (!canEdit) {
    throw new Error('Forbidden');
  }

  return api.asApp().requestJira(route`/rest/api/3/issue/${payload.issueId}`, {
    method: 'PUT',
    body: JSON.stringify(payload.fields)
  });
});

// SECURE - explicit permission check via Forge auth + permissions/check endpoint
resolver.define('updateIssueWithExplicitPermissionEndpoint', async ({ payload }) => {
  const permissionRes = await api.asUser().requestJira(route`/rest/api/3/permissions/check`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      projectPermissions: [
        {
          permissions: ['EDIT_ISSUES'],
          issues: [Number(payload.issueId)]
        }
      ]
    })
  });

  const permissionJson = await permissionRes.json();
  const canEdit = permissionJson?.projectPermissions?.some(
    (grant) =>
      grant.permission === 'EDIT_ISSUES' &&
      Array.isArray(grant.issues) &&
      grant.issues.includes(Number(payload.issueId))
  ) === true;
  if (!canEdit) {
    throw new Error('Forbidden');
  }

  // Uses the same issueId that was authorized above.
  return api.asApp().requestJira(route`/rest/api/3/issue/${payload.issueId}`, {
    method: 'PUT',
    body: JSON.stringify(payload.fields)
  });
});

Detection Checklist

  • Identify all asApp() usage sites in resolvers, functions, and handlers.
  • For each asApp() call in a user-invoked flow, verify an explicit permission check exists before the sink.
  • Confirm the authorization check is coupled to the same resource ID(s) used by the asApp() operation.
  • Reject generic checks (for example, global role checks) when object-level permissions are required.
  • Confirm asUser() is used when the operation should respect user's permissions.
  • Review Rovo agent actions for asApp usage without Convo AI authorization context.

Read the full file on GitHub · 175 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +5 lines 4a2e7c2535be
  2. 3mo ago First seen · 170 lines · 13 tokens per session scan A 97836e4b5c81

Subscribe to this mod's changes

asapp-privilege-escalation is a cursor rule published in the GitHub repository atlassian/forge-skills (35 stars, last pushed 4d ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,700 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

asapp-privilege-escalation compared with cursor rules from other repositories

asapp-privilege-escalation next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
asapp-privilege-escalationatlassian/forge-skillsCursor rule354d agoApache-2.0A13Cursor
ponytailDietrichGebert/ponytailCursor rule201k8d agoMITA604Cursor
angular-20angular/angularCursor rule102k4d agoMITA0Cursor
dev-standardapache/supersetCursor rule76ktodayApache-2.0A1,147Cursor
prefer-assertions-over-defensive-checksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
prefer-direct-imports-over-module-mocksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
shared-plane-packagesprisma/ormCursor rule48ktodayApache-2.0A0Cursor