Skip to content

Security: CreateCoupon tool missing workspace context/authorization #5

@Snider

Description

@Snider

Issue

The CreateCoupon tool at src/Mcp/Tools/Commerce/CreateCoupon.php does not use the RequiresWorkspaceContext trait that other commerce tools use (like UpgradePlan). This means the tool can potentially be called without proper workspace authorization.

File

src/Mcp/Tools/Commerce/CreateCoupon.php

Impact

  • The tool creates coupons globally without workspace scoping
  • No authorization check ensures the caller has permission to create coupons
  • Potential for unauthorized coupon creation if the MCP endpoint is exposed

Recommendation

  1. Add use RequiresWorkspaceContext; trait
  2. Verify the caller has permission to create coupons (e.g., admin role check)
  3. Consider whether coupons should be workspace-scoped

Severity

High - Authorization bypass vulnerability

Metadata

Metadata

Assignees

No one assigned

    Labels

    julesFor Jules AI to work onlang:phpPHP/Laravel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions