| 85 | * @returns true if the name is blocked (impersonates official), false if allowed |
| 86 | */ |
| 87 | export function isBlockedOfficialName(name: string): boolean { |
| 88 | // If it's in the allowed list, it's not blocked |
| 89 | if (ALLOWED_OFFICIAL_MARKETPLACE_NAMES.has(name.toLowerCase())) { |
| 90 | return false |
| 91 | } |
| 92 | |
| 93 | // Block names with non-ASCII characters to prevent homograph attacks |
| 94 | // (e.g., using Cyrillic 'а' to impersonate 'anthropic') |
| 95 | if (NON_ASCII_PATTERN.test(name)) { |
| 96 | return true |
| 97 | } |
| 98 | |
| 99 | // Check if it matches the blocked pattern |
| 100 | return BLOCKED_OFFICIAL_NAME_PATTERN.test(name) |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * The official GitHub organization for Anthropic marketplaces. |