Skip to content

Lee at zoo corp/ttc ux 1 #7542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

lee-at-zoo-corp
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jun 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 7, 2025 6:48pm

status: 'completed',
updated_at: Math.random(),
// declare type ApiTokenUuid_type = string;
user_id: Math.random().toString(),

Check failure

Code scanning / CodeQL

Insecure randomness High

This uses a cryptographically insecure random number generated at
Math.random()
in a security context.

Copilot Autofix

AI 15 days ago

To fix the issue, replace the use of Math.random() with a cryptographically secure random number generator. For Node.js, crypto.randomUUID() is a suitable choice for generating unique identifiers securely. This ensures that the user_id is generated in a way that is resistant to prediction or manipulation.

The changes will involve:

  1. Importing the crypto module from Node.js.
  2. Replacing Math.random().toString() with crypto.randomUUID() for generating the user_id.
Suggested changeset 1
src/lib/prompt.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/lib/prompt.ts b/src/lib/prompt.ts
--- a/src/lib/prompt.ts
+++ b/src/lib/prompt.ts
@@ -1,2 +1,3 @@
 import type { Models } from '@kittycad/lib'
+import * as crypto from 'crypto';
 
@@ -147,3 +148,3 @@
   // declare type ApiTokenUuid_type = string;
-  user_id: Math.random().toString(),
+  user_id: crypto.randomUUID(),
 })
EOF
@@ -1,2 +1,3 @@
import type { Models } from '@kittycad/lib'
import * as crypto from 'crypto';

@@ -147,3 +148,3 @@
// declare type ApiTokenUuid_type = string;
user_id: Math.random().toString(),
user_id: crypto.randomUUID(),
})
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How the fuck do I delete you

@lee-at-zoo-corp lee-at-zoo-corp force-pushed the lee-at-zoo-corp/ttc-ux-1 branch 2 times, most recently from c0c5e7b to 4a46a24 Compare June 19, 2025 19:46
Copy link

vercel bot commented Jul 9, 2025

Deployment failed with the following error:

You must set up Two-Factor Authentication before accessing this team.

View Documentation: https://vercel.com/docs/two-factor-authentication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant