shipclear 0.2.0 → 1.0.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.
package/README.md CHANGED
@@ -32,7 +32,7 @@ npx shipclear ship
32
32
  That runs the full gate and gives you a verdict:
33
33
 
34
34
  ```
35
- ShipClear v0.2.0 — ship report
35
+ ShipClear v1.0.0 — ship report
36
36
 
37
37
  🛑 CRITICAL A secret key is written directly in your code
38
38
  where: server.js:7 — OpenAI API key: `sk-FAKE0…`
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipclear",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "description": "Security companion for AI-assisted coding: prevention rules applied to every task, a commit guard that blocks leaked secrets, and the /safe-to-ship gate.",
5
5
  "author": { "name": "Adam Timmerberg" },
6
6
  "homepage": "https://github.com/adamtimmerberg/ShipClear"
package/cli/lib/checks.js CHANGED
@@ -80,7 +80,7 @@ export function runGate(root, { quick = false } = {}) {
80
80
  severity: 'high',
81
81
  file: rel,
82
82
  line: i + 1,
83
- detail: 'An email + password pair is written directly in the code.',
83
+ detail: 'A login (username or email) and password pair is written directly in the code.',
84
84
  });
85
85
  }
86
86
  });
@@ -173,10 +173,21 @@ export function realLookingEmails(content) {
173
173
  // No leading \b, so it also fires inside names like TEST_PASSWORD; the
174
174
  // two-signal test-account rule (a suspicious account email nearby) keeps the
175
175
  // broader match from producing false findings on its own.
176
- export const PASSWORD_ASSIGNMENT = /(?:pass(?:word|wd)?|pword|pwd)[a-z0-9_]*["']?\s*[:=]\s*['"][^'"\n]{4,}['"]/i;
177
-
178
- // Quoted email that smells like a built-in account.
179
- export const SUSPICIOUS_ACCOUNT_EMAIL = /['"][a-z0-9._%+-]*(?:admin|test|demo|root|superuser)[a-z0-9._%+-]*@[a-z0-9.-]+\.[a-z]{2,}['"]/i;
176
+ // The optional env-fallback group covers `ADMIN_PASSWORD = process.env.X ||
177
+ // "literal"` / `?? "literal"` — found missed on a real AI-generated app: an
178
+ // otherwise reasonable-looking "overridable via env" default that still
179
+ // ships a real hardcoded password when no env var is set.
180
+ export const PASSWORD_ASSIGNMENT = /(?:pass(?:word|wd)?|pword|pwd)[a-z0-9_]*["']?\s*[:=]\s*(?:process\.env\.[A-Z0-9_]+\s*(?:\|\||\?\?)\s*)?['"][^'"\n]{4,}['"]/i;
181
+
182
+ // Quoted email that smells like a built-in account, OR a bare privileged
183
+ // username/role literal (admin, root, superuser, test, demo) assigned,
184
+ // directly or via the same env-fallback idiom, to an identifier that reads
185
+ // as an account holder (user/username/login/account/email). The bare-
186
+ // username branch exists because `ADMIN_USER = process.env.ADMIN_USER ||
187
+ // "admin"` — no email in sight — is at least as common in real AI-written
188
+ // "quick gate for now" code as an admin@... literal, and the original
189
+ // email-only form missed it entirely on a real generated app.
190
+ export const SUSPICIOUS_ACCOUNT_EMAIL = /['"][a-z0-9._%+-]*(?:admin|test|demo|root|superuser)[a-z0-9._%+-]*@[a-z0-9.-]+\.[a-z]{2,}['"]|(?:user|username|login|account|email)[a-z0-9_]*["']?\s*[:=]\s*(?:process\.env\.[A-Z0-9_]+\s*(?:\|\||\?\?)\s*)?['"](?:admin|test|demo|root|superuser)['"]/i;
180
191
 
181
192
  // Turning off TLS certificate checking — the "fix" an AI assistant reaches
182
193
  // for when a request fails with a certificate error. Deterministic and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipclear",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "description": "The last command before you launch. A free, local, cross-agent security gate for AI-built apps: prevents leaked secrets while you build, blocks them at commit time, and gives you a plain-English safe-to-ship verdict.",
5
5
  "keywords": [
6
6
  "security",