launch-doctor 0.4.2 → 0.4.4
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/CHANGELOG.md +54 -1
- package/README.md +30 -6
- package/dist/src/baseline.d.ts +9 -0
- package/dist/src/baseline.js +26 -0
- package/dist/src/checks/email.js +3 -1
- package/dist/src/checks/secrets.js +3 -1
- package/dist/src/cli.js +240 -88
- package/dist/src/core.d.ts +85 -0
- package/dist/src/core.js +166 -0
- package/dist/src/explanations.d.ts +24 -0
- package/dist/src/explanations.js +562 -0
- package/dist/src/git.d.ts +1 -1
- package/dist/src/git.js +6 -3
- package/dist/src/hooks-setup.js +19 -6
- package/dist/src/index.js +2 -1
- package/dist/src/init.d.ts +17 -0
- package/dist/src/init.js +73 -6
- package/dist/src/live.js +3 -0
- package/dist/src/mcp.d.ts +126 -11
- package/dist/src/mcp.js +294 -148
- package/dist/src/prompt.d.ts +9 -0
- package/dist/src/prompt.js +84 -0
- package/dist/src/report-md.d.ts +14 -0
- package/dist/src/report-md.js +71 -0
- package/dist/src/safe-fs.d.ts +9 -0
- package/dist/src/safe-fs.js +27 -1
- package/dist/src/short-report.d.ts +2 -0
- package/dist/src/short-report.js +5 -0
- package/dist/src/types.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
const IGNORE_HINT = 'If it really is fine, add the rule id to .launchdoctorignore or put a launch-doctor-ignore comment on the line.';
|
|
2
|
+
/** A leaked key: the same advice for every provider, with what the key unlocks. */
|
|
3
|
+
function keyRule(name, unlocks, testKey = false) {
|
|
4
|
+
return {
|
|
5
|
+
title: `${name} in the code`,
|
|
6
|
+
whyItMatters: testKey
|
|
7
|
+
? `A ${name} is not your live account, but anyone who copies it can still ${unlocks}, and it shows the habit of keeping keys in code, which leaks the live key next.`
|
|
8
|
+
: `Anyone who can see this file (a visitor's browser, a public repository, a collaborator, an AI tool) can copy the key and ${unlocks}. Bots scan GitHub and websites for keys within minutes of them appearing.`,
|
|
9
|
+
howToConfirm: 'Open the file at the line shown and check that the value is a real key, not a placeholder. Then check the provider dashboard: if the key is listed there as active, it is live.',
|
|
10
|
+
howToFix: 'Rotate the key first in the provider dashboard (it has already leaked), then move the new one into an environment variable that only server code reads, and remove every copy from the code.',
|
|
11
|
+
falsePositiveHint: `A documented example key, a key in a test fixture that was never valid, or a revoked key is not a risk. ${IGNORE_HINT}`,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export const RULE_EXPLANATIONS = {
|
|
15
|
+
// ---------- secrets ----------
|
|
16
|
+
'stripe-live-key': keyRule('Stripe live secret key', 'charge cards, issue refunds and read your customers'),
|
|
17
|
+
'stripe-test-key': keyRule('Stripe test secret key', 'create test data in your account', true),
|
|
18
|
+
'anthropic-key': keyRule('Anthropic API key', 'run Claude on your bill'),
|
|
19
|
+
'openrouter-key': keyRule('OpenRouter API key', 'run AI models on your bill'),
|
|
20
|
+
'openai-key': keyRule('OpenAI API key', 'run AI models on your bill, often thousands of dollars in a day'),
|
|
21
|
+
'supabase-secret-key': keyRule('Supabase secret key', 'read, change and delete every row, skipping your security rules'),
|
|
22
|
+
'stripe-webhook-secret': keyRule('Stripe webhook signing secret', 'send fake "payment succeeded" events your server will trust'),
|
|
23
|
+
'groq-key': keyRule('Groq API key', 'run AI models on your bill'),
|
|
24
|
+
'huggingface-token': keyRule('Hugging Face token', 'use your Hugging Face account and its private models and data'),
|
|
25
|
+
'aws-key': keyRule('AWS access key', 'use your AWS account, up to starting servers that mine crypto on your bill'),
|
|
26
|
+
'github-token': keyRule('GitHub token', 'read and change your repositories'),
|
|
27
|
+
'slack-token': keyRule('Slack token', 'post and read messages as your Slack app'),
|
|
28
|
+
'sendgrid-key': keyRule('SendGrid API key', 'send email from your domain, ruining its reputation with spam'),
|
|
29
|
+
'resend-key': keyRule('Resend API key', 'send email from your domain, ruining its reputation with spam'),
|
|
30
|
+
'private-key': keyRule('private key', 'act as whatever service the key belongs to (signing, logins, cloud accounts)'),
|
|
31
|
+
'paddle-live-key': keyRule('Paddle live API key', 'manage your products, prices and customers'),
|
|
32
|
+
'paddle-sandbox-key': keyRule('Paddle sandbox API key', 'change your sandbox account', true),
|
|
33
|
+
'convex-deploy-key': keyRule('Convex deploy key', 'deploy their own code to your backend and read all its data'),
|
|
34
|
+
'appwrite-api-key': keyRule('Appwrite API key', 'read and change your Appwrite data with the key’s full permissions'),
|
|
35
|
+
'clerk-secret-key': keyRule('Clerk secret key', 'create, change and delete your users and sign in as them'),
|
|
36
|
+
'clerk-test-secret-key': keyRule('Clerk development secret key', 'manage the users of your development instance', true),
|
|
37
|
+
'lemonsqueezy-api-key': keyRule('Lemon Squeezy API key', 'manage your store, orders and customers'),
|
|
38
|
+
'database-password': {
|
|
39
|
+
title: 'Database password in the code',
|
|
40
|
+
whyItMatters: 'Anyone who sees the connection string can log straight into your database and read, change or delete everything, without going through your app.',
|
|
41
|
+
howToConfirm: 'Check that the host in the connection string is your real database (not localhost) and that the password works.',
|
|
42
|
+
howToFix: 'Change the database password in your provider dashboard, then read the connection string from an environment variable such as DATABASE_URL, only on the server.',
|
|
43
|
+
falsePositiveHint: `A connection string for a local or throwaway database (a Docker container in a test setup) is not a risk. ${IGNORE_HINT}`,
|
|
44
|
+
},
|
|
45
|
+
'supabase-service-role-key': {
|
|
46
|
+
title: 'Supabase service_role key in the code',
|
|
47
|
+
whyItMatters: 'The service_role key skips every Row Level Security rule. Anyone who finds it can read and delete every row in every table.',
|
|
48
|
+
howToConfirm: 'Decode the key (it is a JWT): if its role is service_role and the project ref is yours, it is real.',
|
|
49
|
+
howToFix: 'Roll the key in the Supabase dashboard, keep the new one only in server code (an Edge Function or API route) and use the anon key in the browser.',
|
|
50
|
+
falsePositiveHint: `The keys "supabase start" prints for a local database are public and are already skipped. ${IGNORE_HINT}`,
|
|
51
|
+
},
|
|
52
|
+
'public-secret-variable': {
|
|
53
|
+
title: 'Secret in a public environment variable',
|
|
54
|
+
whyItMatters: 'Variables starting with NEXT_PUBLIC_, VITE_, REACT_APP_, EXPO_PUBLIC_ and similar are copied into the JavaScript every visitor downloads. A key in one is public, so anyone can use it on your bill.',
|
|
55
|
+
howToConfirm: "Build the app and search the output (or your live site's JavaScript) for the variable's value. If it is there, it is public.",
|
|
56
|
+
howToFix: 'Rotate the key, rename the variable without the public prefix, and move the code that uses it into a server route the browser calls.',
|
|
57
|
+
falsePositiveHint: `Some values are meant to be public (a Supabase anon key, a Stripe publishable key, a site URL). If the name only sounds secret, ${IGNORE_HINT.charAt(0).toLowerCase()}${IGNORE_HINT.slice(1)}`,
|
|
58
|
+
},
|
|
59
|
+
'env-committed': {
|
|
60
|
+
title: '.env file saved in git',
|
|
61
|
+
whyItMatters: 'Everyone who can clone the repository gets the keys in it, and they stay in git history even after the file is deleted.',
|
|
62
|
+
howToConfirm: 'Run "git ls-files .env*". If the file is listed and holds real keys, they are exposed to everyone with access to the repository.',
|
|
63
|
+
howToFix: 'Rotate every real key in the file, run "git rm --cached" on it, add it to .gitignore and keep a .env.example with empty values instead.',
|
|
64
|
+
falsePositiveHint: 'A committed .env that only holds placeholders and public settings is reported as a warning, not critical. Keep real keys out of it.',
|
|
65
|
+
},
|
|
66
|
+
'env-not-ignored': {
|
|
67
|
+
title: '.env file not in .gitignore',
|
|
68
|
+
whyItMatters: 'The next "git add ." uploads your keys with your code, and from then on they are in git history.',
|
|
69
|
+
howToConfirm: 'Run "git check-ignore -v .env". If it prints nothing, the file is not ignored.',
|
|
70
|
+
howToFix: 'Add ".env*" and "!.env.example" to .gitignore.',
|
|
71
|
+
falsePositiveHint: 'If your project is not in git and never will be, it does not matter yet; it will the day you push it.',
|
|
72
|
+
},
|
|
73
|
+
'secret-in-history': {
|
|
74
|
+
title: 'Key still in git history',
|
|
75
|
+
whyItMatters: 'The key was removed from the code, but anyone who can clone the repository can find it in old commits and use it.',
|
|
76
|
+
howToConfirm: 'Run "git log -p -S <the first characters of the key>" to see the commit that added it.',
|
|
77
|
+
howToFix: 'Rotate the key: that is what matters. Rewriting history (git filter-repo) only helps if nobody has copied it yet, and needs a force-push.',
|
|
78
|
+
falsePositiveHint: 'A key that was revoked long ago is harmless. Rotate anything you are not sure about.',
|
|
79
|
+
},
|
|
80
|
+
// ---------- database ----------
|
|
81
|
+
'supabase-rls-missing': {
|
|
82
|
+
title: 'Supabase table without Row Level Security',
|
|
83
|
+
whyItMatters: 'Your Supabase anon key is in your website, which is normal. Without Row Level Security, anyone holding that key can read, change or delete every row in the table from their browser console.',
|
|
84
|
+
howToConfirm: 'In the Supabase dashboard, open Table Editor: tables without RLS are marked. Or run "select relname from pg_class where relrowsecurity = false".',
|
|
85
|
+
howToFix: 'Enable Row Level Security on the table and add policies so users can only read and change their own rows (auth.uid() = user_id).',
|
|
86
|
+
falsePositiveHint: 'A table enabled in a later migration, or in the dashboard, can be missed. If RLS is on in the dashboard, add the rule id to .launchdoctorignore.',
|
|
87
|
+
},
|
|
88
|
+
'supabase-open-policy': {
|
|
89
|
+
title: 'Supabase policy that lets anyone write',
|
|
90
|
+
whyItMatters: 'A policy with "true" as its rule lets anyone, even signed-out visitors, add, edit or delete rows. It is as open as having no RLS at all.',
|
|
91
|
+
howToConfirm: 'In the dashboard under Authentication > Policies, look for the policy named in the finding and check its USING and WITH CHECK expressions.',
|
|
92
|
+
howToFix: 'Replace it with a policy that checks ownership, for example "using (auth.uid() = user_id)".',
|
|
93
|
+
falsePositiveHint: `A table that really is meant to be written by anyone (a public guestbook) is rare; add rate limits and ${IGNORE_HINT.charAt(0).toLowerCase()}${IGNORE_HINT.slice(1)}`,
|
|
94
|
+
},
|
|
95
|
+
'supabase-signed-in-write-policy': {
|
|
96
|
+
title: 'Any signed-in user can change every row',
|
|
97
|
+
whyItMatters: 'Anyone can sign up, so "any signed-in user" means anyone. They can edit or delete other people’s rows.',
|
|
98
|
+
howToConfirm: 'Sign in as a second test user and try to update a row that belongs to the first.',
|
|
99
|
+
howToFix: 'Check ownership in the policy: "using (auth.uid() = user_id) with check (auth.uid() = user_id)".',
|
|
100
|
+
falsePositiveHint: `A shared table that every member really should be able to edit (a team board) is fine. ${IGNORE_HINT}`,
|
|
101
|
+
},
|
|
102
|
+
'supabase-signed-in-read-policy': {
|
|
103
|
+
title: 'Any signed-in user can read every row',
|
|
104
|
+
whyItMatters: 'Anyone can sign up and then read every row, including other users’ private data.',
|
|
105
|
+
howToConfirm: 'Sign in as a second test user and query the table: if you see the first user’s rows, the data is open.',
|
|
106
|
+
howToFix: 'Limit reads to the owner ("using (auth.uid() = user_id)"), or to members of the same team.',
|
|
107
|
+
falsePositiveHint: `Data that every user is meant to see (a product catalogue, public posts) is fine. ${IGNORE_HINT}`,
|
|
108
|
+
},
|
|
109
|
+
'supabase-public-bucket': {
|
|
110
|
+
title: 'Public Supabase Storage bucket with private-sounding files',
|
|
111
|
+
whyItMatters: 'Files in a public bucket can be downloaded by anyone who has or guesses the URL. Invoices, IDs or uploads in it are exposed.',
|
|
112
|
+
howToConfirm: 'In Storage, check whether the bucket is marked Public and what is stored in it.',
|
|
113
|
+
howToFix: 'Make the bucket private and hand out signed URLs (createSignedUrl) that expire.',
|
|
114
|
+
falsePositiveHint: `Avatars, product images and other files meant for everyone belong in a public bucket. ${IGNORE_HINT}`,
|
|
115
|
+
},
|
|
116
|
+
'supabase-storage-open-write': {
|
|
117
|
+
title: 'Storage policy lets people upload, replace or delete files',
|
|
118
|
+
whyItMatters: 'Anyone it covers can overwrite or delete other people’s files, or fill your bucket (and your bill) with their own, including malware hosted on your domain.',
|
|
119
|
+
howToConfirm: 'Read the policy on storage.objects named in the finding: it checks the bucket but not who owns the file.',
|
|
120
|
+
howToFix: 'Add an ownership check, for example that the first folder of the path is the user’s id ((storage.foldername(name))[1] = auth.uid()::text).',
|
|
121
|
+
falsePositiveHint: `An upload-only bucket for a public form can be intended; add size limits and a captcha. ${IGNORE_HINT}`,
|
|
122
|
+
},
|
|
123
|
+
'firebase-open-rules': {
|
|
124
|
+
title: 'Firebase rules let anyone read or write',
|
|
125
|
+
whyItMatters: 'Test-mode or open rules let anyone on the internet read and change all your data. Test mode also expires on a date, and then your app stops working for everyone.',
|
|
126
|
+
howToConfirm: 'In the Firebase console, open the Rules tab and use the Rules Playground with an unauthenticated request.',
|
|
127
|
+
howToFix: 'Write rules that require request.auth and check that the document belongs to the user.',
|
|
128
|
+
falsePositiveHint: 'Rules files that are never deployed (an old copy) can be flagged. Check which file firebase.json points to.',
|
|
129
|
+
},
|
|
130
|
+
'convex-public-mutation': {
|
|
131
|
+
title: 'Convex function anyone can call',
|
|
132
|
+
whyItMatters: 'Public Convex mutations and actions can be called by anyone with your deployment URL, without signing in.',
|
|
133
|
+
howToConfirm: 'Look for ctx.auth.getUserIdentity() (or your auth helper) at the start of the function.',
|
|
134
|
+
howToFix: 'Check the identity at the start, or make the function internal (internalMutation) if only your backend calls it.',
|
|
135
|
+
falsePositiveHint: `Functions meant for signed-out visitors (a contact form) are fine with a rate limit. ${IGNORE_HINT}`,
|
|
136
|
+
},
|
|
137
|
+
'appwrite-open-permission': {
|
|
138
|
+
title: 'Appwrite permission for anyone',
|
|
139
|
+
whyItMatters: 'A permission granted to "any" or "guests" lets anyone use your public project id to change or delete documents without signing in.',
|
|
140
|
+
howToConfirm: 'In the Appwrite console, open the collection’s Settings > Permissions and look for Any or Guests.',
|
|
141
|
+
howToFix: 'Grant write permissions to Role.user(id) for the document’s owner instead.',
|
|
142
|
+
falsePositiveHint: `Create-only permission for a public form can be intended; add a captcha. ${IGNORE_HINT}`,
|
|
143
|
+
},
|
|
144
|
+
'appwrite-signed-in-write': {
|
|
145
|
+
title: 'Every signed-in Appwrite user can change data',
|
|
146
|
+
whyItMatters: 'Anyone can create an account, so Role.users() means anyone can change or delete these documents.',
|
|
147
|
+
howToConfirm: 'Sign in as a second test user and try to update the first user’s document.',
|
|
148
|
+
howToFix: 'Give update and delete permission to Role.user(ownerId) per document.',
|
|
149
|
+
falsePositiveHint: `Data shared by all members on purpose is fine. ${IGNORE_HINT}`,
|
|
150
|
+
},
|
|
151
|
+
'sqlite-on-serverless': {
|
|
152
|
+
title: 'SQLite on serverless hosting',
|
|
153
|
+
whyItMatters: 'Serverless hosts (Vercel, Netlify) give each request a fresh, temporary disk. Data written to SQLite disappears, or each instance sees different data.',
|
|
154
|
+
howToConfirm: 'Write a record in production, redeploy, and check whether it is still there.',
|
|
155
|
+
howToFix: 'Use a hosted database (Postgres, Turso, PlanetScale, Supabase) instead of a local file.',
|
|
156
|
+
falsePositiveHint: 'Read-only SQLite files shipped with the app, or hosting with a persistent disk (a VPS, Fly volumes), are fine.',
|
|
157
|
+
},
|
|
158
|
+
'prisma-db-push': {
|
|
159
|
+
title: 'prisma db push or --accept-data-loss in a deploy script',
|
|
160
|
+
whyItMatters: 'db push changes the production schema without migrations, and --accept-data-loss drops columns and their data without asking.',
|
|
161
|
+
howToConfirm: 'Check which script your host runs on deploy (package.json scripts, build command).',
|
|
162
|
+
howToFix: 'Use "prisma migrate dev" locally and "prisma migrate deploy" in production.',
|
|
163
|
+
falsePositiveHint: 'db push in a script used only for local development or a throwaway preview database is fine.',
|
|
164
|
+
},
|
|
165
|
+
// ---------- access control ----------
|
|
166
|
+
'server-action-no-auth': {
|
|
167
|
+
title: 'Server Action changes data without checking who calls it',
|
|
168
|
+
whyItMatters: 'Server Actions are public endpoints: anyone can call them with any arguments, signed in or not, even if the button is hidden.',
|
|
169
|
+
howToConfirm: 'Look for a session or user check at the start of the action, before the database write.',
|
|
170
|
+
howToFix: 'Get the user at the start (auth(), getServerSession, supabase.auth.getUser) and return an error if there is none or they may not do this.',
|
|
171
|
+
falsePositiveHint: `Checks in a shared wrapper or a data layer the scanner can't see, or an action meant for visitors (a contact form), can be flagged. ${IGNORE_HINT}`,
|
|
172
|
+
},
|
|
173
|
+
'api-write-no-auth': {
|
|
174
|
+
title: 'API route changes data without checking who calls it',
|
|
175
|
+
whyItMatters: 'Anyone who finds the URL can call it with curl and change or delete data, no account needed.',
|
|
176
|
+
howToConfirm: 'Call the route without being signed in (for example with curl). If it succeeds, it is open.',
|
|
177
|
+
howToFix: 'Check the session at the start of the handler (or in middleware that really covers this route) and reject requests without one.',
|
|
178
|
+
falsePositiveHint: `Middleware in another file, a gateway in front of the app, or a route meant to be public (webhooks, sign-up) can be flagged. ${IGNORE_HINT}`,
|
|
179
|
+
},
|
|
180
|
+
'missing-ownership-check': {
|
|
181
|
+
title: 'Record loaded by id with no owner check (IDOR)',
|
|
182
|
+
whyItMatters: 'A signed-in user can change the id in the request and read or change someone else’s order, invoice or profile.',
|
|
183
|
+
howToConfirm: 'Sign in as user A, take the id of user B’s record and request it. If you get it, it is open.',
|
|
184
|
+
howToFix: 'Filter by owner as well as id ("where id = ? and user_id = currentUser"), or compare the owner before returning or changing the record.',
|
|
185
|
+
falsePositiveHint: `Ownership checked in a helper, an ORM extension or a database rule the scanner can't see, or data that is meant to be shared, can be flagged. ${IGNORE_HINT}`,
|
|
186
|
+
},
|
|
187
|
+
'user-metadata-role': {
|
|
188
|
+
title: 'Role or plan read from user-editable metadata',
|
|
189
|
+
whyItMatters: 'Users can change their own Supabase user_metadata and Clerk unsafeMetadata from the browser, so anyone can make themselves an admin or a paying customer.',
|
|
190
|
+
howToConfirm: 'In the browser console, call supabase.auth.updateUser({ data: { role: "admin" } }) as a normal user and see if you get admin access.',
|
|
191
|
+
howToFix: 'Keep roles in app_metadata (Supabase) or publicMetadata (Clerk), which only the server can change, or in your own table.',
|
|
192
|
+
falsePositiveHint: `Metadata that only drives cosmetic things (a theme, a display name) is fine. ${IGNORE_HINT}`,
|
|
193
|
+
},
|
|
194
|
+
'mass-assignment': {
|
|
195
|
+
title: 'Whole request body saved to the database',
|
|
196
|
+
whyItMatters: 'A user can add fields the form never shows, such as role, isAdmin, credits or userId, and the server saves them.',
|
|
197
|
+
howToConfirm: 'Send the same request with an extra field like "role": "admin" and check whether it was saved.',
|
|
198
|
+
howToFix: 'Pick the allowed fields explicitly (or validate with a schema such as zod) before saving.',
|
|
199
|
+
falsePositiveHint: `If the body is already validated against a strict schema elsewhere, it is fine. ${IGNORE_HINT}`,
|
|
200
|
+
},
|
|
201
|
+
'client-only-admin-check': {
|
|
202
|
+
title: 'Admin check only in browser code',
|
|
203
|
+
whyItMatters: 'Anything in the browser can be changed with the developer tools. Hiding the admin page does not protect the API behind it.',
|
|
204
|
+
howToConfirm: 'Call the admin API routes directly as a normal user. If they work, the check is only cosmetic.',
|
|
205
|
+
howToFix: 'Check the role on the server, in every admin route or in middleware.',
|
|
206
|
+
falsePositiveHint: `If every admin API route already checks the role on the server, the browser check is just for display. ${IGNORE_HINT}`,
|
|
207
|
+
},
|
|
208
|
+
'jwt-not-verified': {
|
|
209
|
+
title: 'JWT decoded without verifying it',
|
|
210
|
+
whyItMatters: 'Decoding is not verifying: anyone can write a token that says they are any user or an admin.',
|
|
211
|
+
howToConfirm: 'Look for jwt.decode (or jwtDecode) used to decide who the user is, without jwt.verify.',
|
|
212
|
+
howToFix: 'Use jwt.verify (or your auth library’s verify function) with your secret or public key.',
|
|
213
|
+
falsePositiveHint: `Decoding only to show something (an expiry time) after the server has verified the token is fine. ${IGNORE_HINT}`,
|
|
214
|
+
},
|
|
215
|
+
'jwt-none-algorithm': {
|
|
216
|
+
title: 'Tokens with no signature are accepted',
|
|
217
|
+
whyItMatters: 'With the "none" algorithm, a token needs no signature, so anyone can sign in as any user.',
|
|
218
|
+
howToConfirm: 'Look at the algorithms option of the verify call.',
|
|
219
|
+
howToFix: 'Allow only the algorithm your tokens are signed with (HS256 or RS256).',
|
|
220
|
+
falsePositiveHint: 'This is almost never intended outside a test.',
|
|
221
|
+
},
|
|
222
|
+
'supabase-getsession-server': {
|
|
223
|
+
title: 'supabase.auth.getSession() trusted on the server',
|
|
224
|
+
whyItMatters: 'On the server, getSession reads the cookie without checking it, so a forged cookie passes as a signed-in user.',
|
|
225
|
+
howToConfirm: 'Look for getSession() in server code (middleware, route handlers, server components) used to allow access.',
|
|
226
|
+
howToFix: 'Use supabase.auth.getUser() (or getClaims()) on the server, which checks the token with Supabase.',
|
|
227
|
+
falsePositiveHint: `getSession used only to read display data, after getUser has run, is fine. ${IGNORE_HINT}`,
|
|
228
|
+
},
|
|
229
|
+
// ---------- payments ----------
|
|
230
|
+
...webhookRules('Stripe', 'stripe'),
|
|
231
|
+
...webhookRules('Lemon Squeezy', 'lemonsqueezy'),
|
|
232
|
+
...webhookRules('Paddle', 'paddle'),
|
|
233
|
+
'razorpay-unverified': {
|
|
234
|
+
title: 'Razorpay payments not verified on the server',
|
|
235
|
+
whyItMatters: 'Without checking Razorpay’s signature on the server, someone can fake a successful payment from the browser and get your product free.',
|
|
236
|
+
howToConfirm: 'Look for a server-side HMAC check of razorpay_order_id|razorpay_payment_id with your key secret.',
|
|
237
|
+
howToFix: 'Verify razorpay_signature on the server (or use a verified webhook) before marking the order paid.',
|
|
238
|
+
falsePositiveHint: `Verification in a backend that is not in this repository can be flagged. ${IGNORE_HINT}`,
|
|
239
|
+
},
|
|
240
|
+
// ---------- AI and API costs ----------
|
|
241
|
+
'ai-in-browser': {
|
|
242
|
+
title: 'Paid AI or SMS API called from the browser',
|
|
243
|
+
whyItMatters: 'For the call to work, the secret key has to be in the browser too, so anyone can copy it and run up your bill. Bots look for exactly this.',
|
|
244
|
+
howToConfirm: 'Open your site, look at the network tab: if requests go straight to api.openai.com (or similar) with your key, it is exposed.',
|
|
245
|
+
howToFix: 'Move the call into a server route that checks the user and rate-limits, and rotate the key.',
|
|
246
|
+
falsePositiveHint: `Calls through your own proxy URL, or a browser SDK with per-user keys, are fine. ${IGNORE_HINT}`,
|
|
247
|
+
},
|
|
248
|
+
'ai-endpoint-no-auth': {
|
|
249
|
+
title: 'AI endpoint with no sign-in check',
|
|
250
|
+
whyItMatters: 'Anyone can call your AI route in a loop, and every call is on your bill.',
|
|
251
|
+
howToConfirm: 'Call the route with curl while signed out. If you get an AI answer, it is open.',
|
|
252
|
+
howToFix: 'Require a signed-in user, and add a per-user rate limit and a spending cap with your provider.',
|
|
253
|
+
falsePositiveHint: `A free public demo can be intended; then a strict rate limit and a provider spending cap are a must. ${IGNORE_HINT}`,
|
|
254
|
+
},
|
|
255
|
+
'no-rate-limit': {
|
|
256
|
+
title: 'No rate limiting on AI features',
|
|
257
|
+
whyItMatters: 'One user or bot can send thousands of requests an hour, which can cost hundreds or thousands of dollars.',
|
|
258
|
+
howToConfirm: 'Look for a rate limiter (Upstash Ratelimit, express-rate-limit, a per-user counter) on the AI routes.',
|
|
259
|
+
howToFix: 'Add a per-user and per-IP limit on every route that calls a paid API, and set a monthly cap with the provider.',
|
|
260
|
+
falsePositiveHint: `Limits at a gateway, a CDN or the provider level can't be seen in code. ${IGNORE_HINT}`,
|
|
261
|
+
},
|
|
262
|
+
// ---------- email ----------
|
|
263
|
+
'email-test-sender': {
|
|
264
|
+
title: 'Emails sent from the provider’s test address',
|
|
265
|
+
whyItMatters: 'Resend’s onboarding@resend.dev only delivers to your own address. Real users never get sign-up or receipt emails.',
|
|
266
|
+
howToConfirm: 'Send an email to an address that is not yours and see whether it arrives.',
|
|
267
|
+
howToFix: 'Verify your own domain with the email provider and send from an address on it.',
|
|
268
|
+
falsePositiveHint: 'In local development the test sender is fine; make sure production uses your domain.',
|
|
269
|
+
},
|
|
270
|
+
'email-personal-gmail': {
|
|
271
|
+
title: 'Personal Gmail used to send app email',
|
|
272
|
+
whyItMatters: 'Gmail limits how much you can send, and app email from a personal account lands in spam or gets the account locked.',
|
|
273
|
+
howToConfirm: 'Look for smtp.gmail.com in the mail settings.',
|
|
274
|
+
howToFix: 'Use a transactional email service (Resend, Postmark, SendGrid, SES) with your own domain.',
|
|
275
|
+
falsePositiveHint: 'A tool that emails only you (an admin alert) can be fine.',
|
|
276
|
+
},
|
|
277
|
+
'email-domain-not-found': {
|
|
278
|
+
title: 'Sender domain does not exist',
|
|
279
|
+
whyItMatters: 'Email from a domain with no DNS records is rejected or lands in spam.',
|
|
280
|
+
howToConfirm: 'Look up the domain (for example with "nslookup -type=ns yourdomain.com").',
|
|
281
|
+
howToFix: 'Send from a domain you own and have set up with your email provider.',
|
|
282
|
+
falsePositiveHint: 'A temporary DNS failure can cause this; run the check again.',
|
|
283
|
+
},
|
|
284
|
+
'email-no-spf': {
|
|
285
|
+
title: 'No SPF record for the sender domain',
|
|
286
|
+
whyItMatters: 'Without SPF, mailbox providers can’t tell your email is really from you, so it goes to spam, and others can spoof your domain.',
|
|
287
|
+
howToConfirm: 'Run "nslookup -type=txt yourdomain.com" and look for a record starting with v=spf1.',
|
|
288
|
+
howToFix: 'Add the SPF record your email provider gives you.',
|
|
289
|
+
falsePositiveHint: 'Some providers publish SPF on a bounce subdomain instead; the check knows the common ones.',
|
|
290
|
+
},
|
|
291
|
+
'email-no-dmarc': {
|
|
292
|
+
title: 'No DMARC record for the sender domain',
|
|
293
|
+
whyItMatters: 'Gmail and Yahoo require DMARC for bulk senders; without it email lands in spam and your domain is easier to spoof.',
|
|
294
|
+
howToConfirm: 'Run "nslookup -type=txt _dmarc.yourdomain.com".',
|
|
295
|
+
howToFix: 'Add a TXT record at _dmarc with at least "v=DMARC1; p=none; rua=mailto:you@yourdomain.com", then tighten it later.',
|
|
296
|
+
falsePositiveHint: 'A temporary DNS failure can cause this; run the check again.',
|
|
297
|
+
},
|
|
298
|
+
// ---------- monitoring ----------
|
|
299
|
+
'no-error-tracking': {
|
|
300
|
+
title: 'No error tracking',
|
|
301
|
+
whyItMatters: 'When something breaks for users, nobody tells you. You find out from a refund request or a bad review, days later.',
|
|
302
|
+
howToConfirm: 'Look for Sentry, PostHog, LogRocket, Bugsnag or similar in the dependencies.',
|
|
303
|
+
howToFix: 'Add an error tracker (Sentry has a free tier) to the frontend and the server.',
|
|
304
|
+
falsePositiveHint: 'Error tracking set up only in your hosting provider’s dashboard can’t be seen in code.',
|
|
305
|
+
},
|
|
306
|
+
'no-error-boundary': {
|
|
307
|
+
title: 'No friendly error screen',
|
|
308
|
+
whyItMatters: 'One crash in a component shows users a blank white page with no way back.',
|
|
309
|
+
howToConfirm: 'Throw an error in a component on purpose and see what the page shows.',
|
|
310
|
+
howToFix: 'Add an error boundary (in Next.js, app/error.tsx and app/global-error.tsx) with a message and a way to retry.',
|
|
311
|
+
falsePositiveHint: 'An error boundary from a library or a custom name may not be recognised.',
|
|
312
|
+
},
|
|
313
|
+
// ---------- legal ----------
|
|
314
|
+
'no-privacy-policy': {
|
|
315
|
+
title: 'No privacy policy',
|
|
316
|
+
whyItMatters: 'Collecting emails or using analytics without one breaks the GDPR and similar laws, and app stores and payment providers require one.',
|
|
317
|
+
howToConfirm: 'Look for a /privacy page or a link to one in the footer.',
|
|
318
|
+
howToFix: 'Publish a privacy policy that says what you collect, why, which services get it, and how to get it deleted.',
|
|
319
|
+
falsePositiveHint: 'A policy hosted elsewhere (Termly, Notion) and linked by a full URL may be missed.',
|
|
320
|
+
},
|
|
321
|
+
'no-terms': {
|
|
322
|
+
title: 'No terms of service',
|
|
323
|
+
whyItMatters: 'Without terms you have no stated rules for refunds, abuse or liability, and payment providers ask for them.',
|
|
324
|
+
howToConfirm: 'Look for a /terms page or a link to one.',
|
|
325
|
+
howToFix: 'Publish terms of service and link them from the footer and the sign-up page.',
|
|
326
|
+
falsePositiveHint: 'Terms hosted elsewhere and linked by a full URL may be missed.',
|
|
327
|
+
},
|
|
328
|
+
'no-refund-policy': {
|
|
329
|
+
title: 'No refund or cancellation policy',
|
|
330
|
+
whyItMatters: 'Without a clear policy, unhappy customers go straight to a chargeback, which costs fees and can get your Stripe account reviewed.',
|
|
331
|
+
howToConfirm: 'Look for a refund section in the terms or a /refund page.',
|
|
332
|
+
howToFix: 'State how refunds and cancellations work and link it near the checkout.',
|
|
333
|
+
falsePositiveHint: 'A refund section inside the terms page may not be recognised.',
|
|
334
|
+
},
|
|
335
|
+
'no-contact': {
|
|
336
|
+
title: 'No contact page or email',
|
|
337
|
+
whyItMatters: 'Users with a problem can’t reach you, so they complain publicly or dispute the charge.',
|
|
338
|
+
howToConfirm: 'Look for a contact page, a support email or a chat widget.',
|
|
339
|
+
howToFix: 'Add a contact email or form and link it in the footer.',
|
|
340
|
+
falsePositiveHint: 'A chat widget loaded from a script tag may not be recognised.',
|
|
341
|
+
},
|
|
342
|
+
'no-account-deletion': {
|
|
343
|
+
title: 'Users can’t delete their account',
|
|
344
|
+
whyItMatters: 'The GDPR gives users the right to have their data deleted, and the App Store requires in-app account deletion.',
|
|
345
|
+
howToConfirm: 'Sign in and look for a delete-account option in the settings.',
|
|
346
|
+
howToFix: 'Add a delete-account action that removes the user and their data (and cancels any subscription).',
|
|
347
|
+
falsePositiveHint: 'Deletion handled by email request can satisfy the law for web apps, but not the App Store.',
|
|
348
|
+
},
|
|
349
|
+
// ---------- first impressions ----------
|
|
350
|
+
'default-title': {
|
|
351
|
+
title: 'Browser tab still shows the template title',
|
|
352
|
+
whyItMatters: 'A tab that says "Vite + React" tells every visitor the app is unfinished, and it is what search results show.',
|
|
353
|
+
howToConfirm: 'Open the site and look at the tab title.',
|
|
354
|
+
howToFix: 'Set the <title> (or the metadata title in Next.js) to your product name.',
|
|
355
|
+
falsePositiveHint: 'If the title is set at runtime by your router, the template title only shows for a moment.',
|
|
356
|
+
},
|
|
357
|
+
'lovable-default-meta': {
|
|
358
|
+
title: 'Lovable default meta tags',
|
|
359
|
+
whyItMatters: 'Shared links show Lovable’s default description and image instead of your product.',
|
|
360
|
+
howToConfirm: 'Paste your URL into a link preview tool or a chat app.',
|
|
361
|
+
howToFix: 'Replace the description and og: tags in index.html with your own.',
|
|
362
|
+
falsePositiveHint: 'None expected, unless the text is really yours.',
|
|
363
|
+
},
|
|
364
|
+
'default-favicon': {
|
|
365
|
+
title: 'Site icon is still the framework logo',
|
|
366
|
+
whyItMatters: 'The tab and bookmark show the Vite or Next.js logo instead of yours.',
|
|
367
|
+
howToConfirm: 'Look at the browser tab icon.',
|
|
368
|
+
howToFix: 'Replace the favicon file with your own icon.',
|
|
369
|
+
falsePositiveHint: 'A file with the default name but your own image may be flagged.',
|
|
370
|
+
},
|
|
371
|
+
'no-description': {
|
|
372
|
+
title: 'No page description',
|
|
373
|
+
whyItMatters: 'Search engines and link previews make up a description from random page text.',
|
|
374
|
+
howToConfirm: 'Look for <meta name="description"> in the page head.',
|
|
375
|
+
howToFix: 'Add a one-sentence description of the product.',
|
|
376
|
+
falsePositiveHint: 'A description set at runtime by a head manager may be missed.',
|
|
377
|
+
},
|
|
378
|
+
'no-social-preview': {
|
|
379
|
+
title: 'No social preview image',
|
|
380
|
+
whyItMatters: 'Links shared on X, LinkedIn or Slack show no image, so fewer people click them.',
|
|
381
|
+
howToConfirm: 'Paste your URL into a link preview tool.',
|
|
382
|
+
howToFix: 'Add og:image (and twitter:image) with a 1200x630 image.',
|
|
383
|
+
falsePositiveHint: 'An image generated at runtime (Next.js opengraph-image) may not be recognised.',
|
|
384
|
+
},
|
|
385
|
+
'hardcoded-localhost': {
|
|
386
|
+
title: 'App calls localhost',
|
|
387
|
+
whyItMatters: 'In production, localhost is the visitor’s own computer, so the feature is broken for everyone.',
|
|
388
|
+
howToConfirm: 'Open the live site with the network tab and look for requests to localhost.',
|
|
389
|
+
howToFix: 'Read the API address from an environment variable, or use a relative path like /api/...',
|
|
390
|
+
falsePositiveHint: 'Code that only runs in development (behind a NODE_ENV check) is fine.',
|
|
391
|
+
},
|
|
392
|
+
'mobile-placeholder-app-id': {
|
|
393
|
+
title: 'Placeholder app id',
|
|
394
|
+
whyItMatters: 'App stores reject placeholder ids such as com.anonymous..., and the id can’t be changed after the first release.',
|
|
395
|
+
howToConfirm: 'Check the bundle identifier (iOS) and package (Android) in the Expo config.',
|
|
396
|
+
howToFix: 'Set a reverse-domain id you own, such as com.yourcompany.app, before the first upload.',
|
|
397
|
+
falsePositiveHint: 'None expected for a store app.',
|
|
398
|
+
},
|
|
399
|
+
'android-cleartext-traffic': {
|
|
400
|
+
title: 'Plain http allowed on Android',
|
|
401
|
+
whyItMatters: 'Traffic over plain http can be read and changed by anyone on the same Wi-Fi.',
|
|
402
|
+
howToConfirm: 'Look for usesCleartextTraffic="true" in the manifest or the Expo config.',
|
|
403
|
+
howToFix: 'Remove it and use https everywhere; allow http only for development builds.',
|
|
404
|
+
falsePositiveHint: 'A setting that only applies to debug builds is fine.',
|
|
405
|
+
},
|
|
406
|
+
'ios-arbitrary-loads': {
|
|
407
|
+
title: 'NSAllowsArbitraryLoads on iOS',
|
|
408
|
+
whyItMatters: 'It turns off iOS’s https requirement for every connection, and App Review asks you to justify it.',
|
|
409
|
+
howToConfirm: 'Look in Info.plist or the Expo config under NSAppTransportSecurity.',
|
|
410
|
+
howToFix: 'Remove it and use https, or allow a single domain with an exception.',
|
|
411
|
+
falsePositiveHint: 'Exceptions limited to a local development host are fine.',
|
|
412
|
+
},
|
|
413
|
+
// ---------- live site scan ----------
|
|
414
|
+
'live-exposed-env': {
|
|
415
|
+
title: '.env file downloadable from the live site',
|
|
416
|
+
whyItMatters: 'Anyone can download it and get every key and password in it.',
|
|
417
|
+
howToConfirm: 'Open https://your-site/.env in a private window.',
|
|
418
|
+
howToFix: 'Rotate every key in it, then make sure the file is not in the public or build folder.',
|
|
419
|
+
falsePositiveHint: 'The content is checked before this is reported, so it is rarely wrong.',
|
|
420
|
+
},
|
|
421
|
+
'live-exposed-git': {
|
|
422
|
+
title: '.git folder downloadable from the live site',
|
|
423
|
+
whyItMatters: 'Anyone can rebuild your whole source code and its history, including any key ever committed.',
|
|
424
|
+
howToConfirm: 'Open https://your-site/.git/HEAD in a private window.',
|
|
425
|
+
howToFix: 'Stop deploying the .git folder, and rotate keys that were ever in the history.',
|
|
426
|
+
falsePositiveHint: 'The content is checked before this is reported, so it is rarely wrong.',
|
|
427
|
+
},
|
|
428
|
+
'live-exposed-backup': {
|
|
429
|
+
title: 'Database backup downloadable from the live site',
|
|
430
|
+
whyItMatters: 'Anyone can download your users’ data.',
|
|
431
|
+
howToConfirm: 'Open the path shown in a private window.',
|
|
432
|
+
howToFix: 'Delete the file from the server and keep backups in private storage.',
|
|
433
|
+
falsePositiveHint: 'The content is checked before this is reported, so it is rarely wrong.',
|
|
434
|
+
},
|
|
435
|
+
'live-source-maps': {
|
|
436
|
+
title: 'Public source maps',
|
|
437
|
+
whyItMatters: 'They give anyone your original source code, comments included, which makes it easy to find weak spots.',
|
|
438
|
+
howToConfirm: 'Open one of your JavaScript files with .map added to the URL.',
|
|
439
|
+
howToFix: 'Turn off production source maps, or upload them to your error tracker without serving them.',
|
|
440
|
+
falsePositiveHint: 'Open-source apps may publish them on purpose.',
|
|
441
|
+
},
|
|
442
|
+
'live-secret-in-bundle': {
|
|
443
|
+
title: 'API key in the live JavaScript',
|
|
444
|
+
whyItMatters: 'Every visitor downloads it, so anyone can copy the key and use your account.',
|
|
445
|
+
howToConfirm: 'Search your site’s JavaScript (view source, or the Sources tab) for the start of the key.',
|
|
446
|
+
howToFix: 'Rotate the key, move the code that uses it to the server and redeploy.',
|
|
447
|
+
falsePositiveHint: 'Publishable keys are not reported; a test key may be.',
|
|
448
|
+
},
|
|
449
|
+
'live-supabase-service-role': {
|
|
450
|
+
title: 'Supabase service_role key in the live site',
|
|
451
|
+
whyItMatters: 'It skips every database rule, so anyone who copies it can read, change and delete all your data.',
|
|
452
|
+
howToConfirm: 'Search the site’s JavaScript for a JWT and decode it: the role says service_role.',
|
|
453
|
+
howToFix: 'Roll the key in Supabase now, and use only the anon key in the browser.',
|
|
454
|
+
falsePositiveHint: 'None expected.',
|
|
455
|
+
},
|
|
456
|
+
'live-supabase-open-table': {
|
|
457
|
+
title: 'Supabase table readable by anyone',
|
|
458
|
+
whyItMatters: 'Anyone with your public anon key (it is in your page) can download the rows.',
|
|
459
|
+
howToConfirm: 'In a private window, query the table with the anon key, or check RLS in the dashboard.',
|
|
460
|
+
howToFix: 'Enable Row Level Security with owner-only read policies.',
|
|
461
|
+
falsePositiveHint: 'Tables meant to be public (a product list) are fine.',
|
|
462
|
+
},
|
|
463
|
+
'live-no-https': {
|
|
464
|
+
title: 'Site served over plain http',
|
|
465
|
+
whyItMatters: 'Logins and data can be read and changed by anyone on the same network, and browsers mark the site "Not secure".',
|
|
466
|
+
howToConfirm: 'Open the site and look at the address bar.',
|
|
467
|
+
howToFix: 'Turn on HTTPS at your host (usually one click) and redirect http to https.',
|
|
468
|
+
falsePositiveHint: 'None expected for a public site.',
|
|
469
|
+
},
|
|
470
|
+
'live-http-no-redirect': {
|
|
471
|
+
title: 'http does not redirect to https',
|
|
472
|
+
whyItMatters: 'People who type the address without https stay on the insecure version.',
|
|
473
|
+
howToConfirm: 'Open http://your-site and see whether it switches to https.',
|
|
474
|
+
howToFix: 'Turn on the http-to-https redirect at your host.',
|
|
475
|
+
falsePositiveHint: 'None expected.',
|
|
476
|
+
},
|
|
477
|
+
'live-missing-hsts': {
|
|
478
|
+
title: 'No HSTS header',
|
|
479
|
+
whyItMatters: 'Without it, a first visit over http can be intercepted before the redirect.',
|
|
480
|
+
howToConfirm: 'Look for Strict-Transport-Security in the response headers.',
|
|
481
|
+
howToFix: 'Send "Strict-Transport-Security: max-age=31536000; includeSubDomains".',
|
|
482
|
+
falsePositiveHint: 'Some hosts add it only on the custom domain, not on preview URLs.',
|
|
483
|
+
},
|
|
484
|
+
'live-missing-csp': {
|
|
485
|
+
title: 'No Content-Security-Policy',
|
|
486
|
+
whyItMatters: 'A CSP limits what an injected script can do; without one, one XSS bug can steal sessions.',
|
|
487
|
+
howToConfirm: 'Look for Content-Security-Policy in the response headers.',
|
|
488
|
+
howToFix: 'Start with a report-only policy, then enforce it.',
|
|
489
|
+
falsePositiveHint: 'A CSP set by a meta tag is not seen in headers.',
|
|
490
|
+
},
|
|
491
|
+
'live-missing-basic-headers': {
|
|
492
|
+
title: 'Missing basic security headers',
|
|
493
|
+
whyItMatters: 'Without X-Content-Type-Options, frame protection and Referrer-Policy, your site can be framed for clickjacking and leaks full URLs to other sites.',
|
|
494
|
+
howToConfirm: 'Look at the response headers in the network tab.',
|
|
495
|
+
howToFix: 'Add the headers in your host or framework config (next.config headers, vercel.json, netlify.toml).',
|
|
496
|
+
falsePositiveHint: 'None expected.',
|
|
497
|
+
},
|
|
498
|
+
};
|
|
499
|
+
/** The three webhook rules every payment provider shares. */
|
|
500
|
+
function webhookRules(name, prefix) {
|
|
501
|
+
return {
|
|
502
|
+
[`${prefix}-webhook-unverified`]: {
|
|
503
|
+
title: `${name} webhook does not check the signature`,
|
|
504
|
+
whyItMatters: `Anyone can send a fake "payment succeeded" message to your webhook URL and get your product free. ${name} signs every webhook; unchecked, the signature protects nothing.`,
|
|
505
|
+
howToConfirm: `Look for the signature check (${name === 'Stripe' ? 'stripe.webhooks.constructEvent' : 'an HMAC of the raw body with your webhook secret'}) before the event is used.`,
|
|
506
|
+
howToFix: `Verify the signature on the raw request body with your ${name} webhook secret, and reject the request if it fails.`,
|
|
507
|
+
falsePositiveHint: `Verification in a shared helper in another file can be missed. ${IGNORE_HINT}`,
|
|
508
|
+
},
|
|
509
|
+
[`${prefix}-webhook-parsed-body`]: {
|
|
510
|
+
title: `${name} webhook body parsed before the signature check`,
|
|
511
|
+
whyItMatters: 'The signature is over the exact raw bytes. Once the body is parsed and re-encoded, the check fails for real events, and people "fix" that by turning the check off.',
|
|
512
|
+
howToConfirm: 'Look for express.json() (or req.json()) running before the signature check on the webhook route.',
|
|
513
|
+
howToFix: 'Read the raw body (express.raw on that route, or req.text() in Next.js) and verify that.',
|
|
514
|
+
falsePositiveHint: `A raw-body parser set up for this route in another file can be missed. ${IGNORE_HINT}`,
|
|
515
|
+
},
|
|
516
|
+
[`${prefix}-no-webhook`]: {
|
|
517
|
+
title: `${name} used but no webhook`,
|
|
518
|
+
whyItMatters: 'Without a webhook, the app only learns about payments from the redirect page. Closed tabs, failed renewals, refunds and cancellations are missed, so people keep access they no longer pay for.',
|
|
519
|
+
howToConfirm: `Check whether ${name} sends events to an endpoint in your app (in the ${name} dashboard, Webhooks).`,
|
|
520
|
+
howToFix: 'Add a webhook route that verifies the signature and updates the user on payment, renewal, failure, refund and cancellation.',
|
|
521
|
+
falsePositiveHint: `A webhook handled by another service or repository can't be seen here. ${IGNORE_HINT}`,
|
|
522
|
+
},
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
/** Checklist-only ids: things to check by hand, never reported as findings, so they have no rule explanation. */
|
|
526
|
+
export const CHECKLIST_IDS = new Set([
|
|
527
|
+
'server-actions-middleware-only',
|
|
528
|
+
'test-other-users-data',
|
|
529
|
+
'spending-limits',
|
|
530
|
+
'twilio-geo',
|
|
531
|
+
'supabase-rls-dashboard',
|
|
532
|
+
'supabase-storage-dashboard',
|
|
533
|
+
'supabase-public-read',
|
|
534
|
+
'firebase-rules-console',
|
|
535
|
+
'appwrite-permissions-console',
|
|
536
|
+
'backups',
|
|
537
|
+
'email-dns',
|
|
538
|
+
'email-spf-return-path',
|
|
539
|
+
'email-dkim',
|
|
540
|
+
'supabase-smtp',
|
|
541
|
+
'email-real-inbox',
|
|
542
|
+
'not-found-page',
|
|
543
|
+
'robots-sitemap',
|
|
544
|
+
'phone-test',
|
|
545
|
+
'store-review-account',
|
|
546
|
+
'device-test',
|
|
547
|
+
'cookie-consent',
|
|
548
|
+
'store-crash-reports',
|
|
549
|
+
'other-provider-webhooks',
|
|
550
|
+
'separate-keys',
|
|
551
|
+
'live-test-purchase',
|
|
552
|
+
'failed-and-cancelled',
|
|
553
|
+
'uptime-monitor',
|
|
554
|
+
'know-your-logs',
|
|
555
|
+
'store-listing',
|
|
556
|
+
'store-privacy-labels',
|
|
557
|
+
'clerk-production-instance',
|
|
558
|
+
]);
|
|
559
|
+
/** The explanation of a rule, or null for an unknown id. */
|
|
560
|
+
export function explainRule(ruleId) {
|
|
561
|
+
return RULE_EXPLANATIONS[ruleId] ?? null;
|
|
562
|
+
}
|
package/dist/src/git.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Flags for every command that prints a diff or compares files (log -p, diff). */
|
|
1
|
+
/** Flags for every command that prints a diff or compares files (log -p, diff). See the notes above. */
|
|
2
2
|
export declare const SAFE_DIFF: string[];
|
|
3
3
|
/** No git command we run should take this long; a hang (a FIFO for a config file, for example) is cut off. */
|
|
4
4
|
export declare const GIT_TIMEOUT_MS = 60000;
|
package/dist/src/git.js
CHANGED
|
@@ -13,7 +13,10 @@ import { devNull } from 'node:os';
|
|
|
13
13
|
* - every filter driver the configuration names gets an empty clean, smudge and process command (git runs
|
|
14
14
|
* nothing for an empty one), wherever the attributes that select it come from (.gitattributes,
|
|
15
15
|
* .git/info/attributes or core.attributesFile);
|
|
16
|
-
* - log and diff calls also pass --no-textconv and --no-ext-diff (see SAFE_DIFF)
|
|
16
|
+
* - log and diff calls also pass --no-textconv and --no-ext-diff (see SAFE_DIFF);
|
|
17
|
+
* - and --ignore-submodules=all: otherwise `git diff` runs `git status` inside each checked-out submodule, where the
|
|
18
|
+
* submodule's own config (.git/modules/<name>/config, which a zip of the project can hold) applies, and its filter
|
|
19
|
+
* drivers are ones this repository's config doesn't name, so they can't be emptied here.
|
|
17
20
|
*
|
|
18
21
|
* When a driver name can't be overridden on the command line, git is treated as unavailable.
|
|
19
22
|
*/
|
|
@@ -21,8 +24,8 @@ import { devNull } from 'node:os';
|
|
|
21
24
|
const FIXED = ['--no-pager', '-c', 'core.fsmonitor=false', '-c', 'log.showSignature=false'];
|
|
22
25
|
/** Hooks are looked up in the null device, so none can run (git status-like commands run post-index-change). */
|
|
23
26
|
const NO_HOOKS = ['-c', `core.hooksPath=${devNull}`];
|
|
24
|
-
/** Flags for every command that prints a diff or compares files (log -p, diff). */
|
|
25
|
-
export const SAFE_DIFF = ['--no-textconv', '--no-ext-diff'];
|
|
27
|
+
/** Flags for every command that prints a diff or compares files (log -p, diff). See the notes above. */
|
|
28
|
+
export const SAFE_DIFF = ['--no-textconv', '--no-ext-diff', '--ignore-submodules=all'];
|
|
26
29
|
/** No git command we run should take this long; a hang (a FIFO for a config file, for example) is cut off. */
|
|
27
30
|
export const GIT_TIMEOUT_MS = 60_000;
|
|
28
31
|
const overrideCache = new Map();
|