Skip to main content

Overview

ABP operates in a browser context with access to sensitive capabilities (storage, authenticated sessions, canvas rendering). Proper security measures are essential.

Threat Model

For Web Applications

Threats:
  1. Malicious agents calling capabilities without user consent
  2. Data exfiltration via storage or network access
  3. XSS attacks exploiting ABP interface
  4. CSRF attacks triggering capabilities from other origins
  5. Resource exhaustion from repeated capability calls

For Clients/Bridges

Threats:
  1. Malicious apps exploiting client vulnerabilities
  2. Data injection via crafted responses
  3. Browser exploitation through malicious page content
  4. Man-in-the-middle attacks on manifest/app connections

Security Best Practices

For App Developers

1. Input Validation

Always validate inputs against schemas:

2. Rate Limiting

Prevent abuse with rate limits:

3. Content Security Policy

Restrict what scripts can run:

4. Sanitize Outputs

Prevent XSS in generated content:

5. Limit Sensitive Capabilities

Mark sensitive capabilities as unavailable by default:

6. CORS for Manifests

Only allow specific origins:

For Client/Bridge Developers

1. Validate Manifest

Check manifest before trusting it:

2. Isolate Browser Context

Use sandboxed browser instances:

3. Limit Permissions

Only grant necessary permissions:

4. Timeout Protection

Prevent hanging operations:

5. Validate Responses

Check responses for injection attempts:

Permission Model

Browser Permissions

Some capabilities require browser permissions:

ABP Permission Flow

Manifest Security

Agents and bridges MUST apply security safeguards when discovering and fetching ABP manifests. The manifest is informational only and MUST NOT be implicitly trusted.

URL Validation

Block requests to internal networks:

Fetch Safeguards

Enforce limits when fetching manifests:

Trust Model

The manifest is informational only. Agents:
  • MUST NOT trust manifest capabilities without runtime verification via initialize()
  • MUST NOT execute code or scripts referenced in manifests
  • MUST NOT grant permissions based solely on manifest claims
The manifest enables discovery and filtering. The runtime initialize() handshake establishes actual trust and capabilities.

Common Vulnerabilities

1. Unvalidated Input

Never use eval() or Function() with user-provided input.

2. Path Traversal

3. Prototype Pollution

Audit Checklist

For Apps

  • Input validation on all capabilities
  • Rate limiting implemented
  • Sensitive capabilities gated by permissions
  • Output sanitization for generated content
  • CORS configured for manifest
  • CSP headers in place
  • No eval() or Function() with user input
  • No file system access (browser context)

For Clients

  • Manifest validation
  • Sandboxed browser contexts
  • Timeouts on all operations
  • Response validation
  • HTTPS for manifest/app connections
  • Permission model enforcement
  • Secure temporary file handling

Next Steps

Building ABP Apps

Secure implementation patterns

Error Handling

Secure error messages

Protocol Overview

Protocol details and security context