webtrigger-security

A security rule for Atlassian Forge web triggers, which are public URLs that receive web requests.

In plain words
What is it for?
Use it to inspect web-trigger manifests and handlers for unsafe request processing and weak or missing access checks.
Why use it?
It flags missing authentication, replay protection, and input validation before untrusted requests can reach sensitive operations.

Cursor rule

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.

agentmods
npx agentmods add rules/atlassian/forge-skills/webtrigger-security
Clone the repo
git clone --depth 1 https://github.com/atlassian/forge-skills
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,255 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00013 $0.01255
Opus 5 $0.00006 $0.00628
Sonnet 5 $0.00003 $0.00251
Haiku 4.5 $0.00001 $0.00126

Measured 2d ago against content hash f01fbcdd9d63, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

webtrigger-security 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 2d 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-webtrigger-entrypoints/webtrigger-security.mdc · 174 lines

How it starts

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

Context

  • Forge web triggers are publicly accessible URLs with no built-in authentication. Apps must implement their own authentication, replay protection, and input validation.
  • Related CWE: CWE-306 (Missing Authentication for Critical Function).
  • Known footgun: PBAC-832 - Webtriggers have no supported authentication mechanism.

Scope & Signals

  • Manifest: modules with webtrigger type.
  • Handler functions: Receive HTTP request, return HTTP response.
  • Risk areas:
    • No authentication header validation.
    • No signature/HMAC verification.
    • No replay protection (timestamp/nonce).
    • Direct processing of untrusted request body.
    • Sensitive operations without auth.

Vulnerable Patterns

// VULNERABLE - No authentication whatsoever
export async function webhookHandler(request) {
  const data = JSON.parse(request.body);
  
  // Directly processing untrusted input
  await storage.set(`data-${data.id}`, data.payload);
  
  // Triggering sensitive operations
  await notifyUsers(data.users);
  
  return { statusCode: 200 };
}

// VULNERABLE - Weak authentication (easily bypassed)
export async function webhookHandler(request) {
  const apiKey = request.headers['x-api-key'];
  
  // Hardcoded comparison (timing attack + hardcoded secret)
  if (apiKey !== 'secret-api-key-12345') {
    return { statusCode: 401 };
  }
  
  // Process request...
}

// VULNERABLE - No replay protection
export async function webhookHandler(request) {
  const signature = request.headers['x-signature'];
  
  if (verifySignature(request.body, signature)) {
    // Valid signature, but could be replayed!
    await processPayment(JSON.parse(request.body));
  }
}

Secure Patterns

import crypto from 'crypto';
import { storage } from '@forge/api';

// SECURE - Full authentication with replay protection
export async function webhookHandler(request) {
  // 1. Verify signature
  const signature = request.headers['x-signature'];
  const timestamp = request.headers['x-timestamp'];
  const nonce = request.headers['x-nonce'];
  
  if (!signature || !timestamp || !nonce) {
    return { statusCode: 401, body: 'Missing auth headers' };
  }
  
  // 2. Check timestamp freshness (prevent replay)
  const requestTime = parseInt(timestamp, 10);
  const now = Date.now();
  const MAX_AGE_MS = 5 * 60 * 1000; // 5 minutes
  
  if (Math.abs(now - requestTime) > MAX_AGE_MS) {
    return { statusCode: 400, body: 'Request expired' };
  }
  
  // 3. Check nonce hasn't been used (prevent replay)
  const nonceKey = `nonce:${nonce}`;
  const usedNonce = await storage.get(nonceKey);
  if (usedNonce) {
    return { statusCode: 400, body: 'Nonce already used' };
  }
  
  // 4. Verify HMAC signature
  const secret = await storage.getSecret('webhook-secret');
  const payload = `${timestamp}.${nonce}.${request.body}`;
  const expectedSig = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  
  if (!crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expectedSig)
  )) {
    return { statusCode: 401, body: 'Invalid signature' };
  }
  
  // 5. Store nonce to prevent replay
  await storage.set(nonceKey, { used: true }, { ttl: MAX_AGE_MS / 1000 });
  
  // 6. Validate and process request body
  const data = validateAndParse(request.body);
  await processWebhook(data);
  
  return { statusCode: 200 };
}

// Helper: Constant-time comparison
function secureCompare(a, b) {
  if (a.length !== b.length) return false;
  return crypto.timingSafeEqual(Buffer.from(a), Buffer.from(b));
}

Detection Checklist

  • Identify all webtrigger modules in manifest.yml.
  • For each handler, check for authentication header processing.
  • Verify signature validation uses timing-safe comparison.
  • Check for timestamp validation (freshness).
  • Look for nonce/idempotency key validation.
  • Assess what operations the trigger performs (sensitivity).
  • Verify input validation before processing body.

Authentication Methods

Read the full file on GitHub · 174 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. 2d ago First seen · 174 lines · 13 tokens per session scan A f01fbcdd9d63

Subscribe to this mod's changes

webtrigger-security is a cursor rule published in the GitHub repository atlassian/forge-skills (20 stars, last pushed 2d ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,255 once invoked, about $0.0001 per session on Opus 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.