@trading-boy/cli 1.6.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,8 +115,13 @@ export async function apiRequest(path, options = {}) {
115
115
  let message = 'Subscription inactive. Run `trading-boy billing manage` to update your billing.';
116
116
  try {
117
117
  const body = await response.clone().json();
118
- if (typeof body.error === 'string')
119
- message = body.error;
118
+ if (typeof body.error === 'string') {
119
+ // Only use API message if it matches known safe patterns to avoid leaking internals
120
+ const safePatterns = ['Plan ', 'Subscription ', 'plan ', 'subscription ', 'Trial ', 'trial '];
121
+ if (safePatterns.some((p) => body.error.startsWith(p))) {
122
+ message = body.error;
123
+ }
124
+ }
120
125
  }
121
126
  catch { /* use default message */ }
122
127
  throw new ApiError(message, 403);