-
Notifications
You must be signed in to change notification settings - Fork 371
create_plan api #354
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
create_plan api #354
Conversation
Added link
docs: Update CustomizingAzdParameters.md
fix: Merge the telemetry issue changes from dev to main
fix: added current step action and function with history to execute correct task when approving parallelly
…ndard chore: migrate model type to global standard
fix: add principalType as 'ServicePrincipal' for role assignments
fix: Prefix/Suffix fixes - dev to main
static async createPlan( | ||
description: string | ||
): Promise<{ plan_id: string; status: string; session_id: string }> { | ||
const sessionId = this.generateSessionId(); |
Check failure
Code scanning / CodeQL
Insecure randomness High
Math.random()
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, replace the use of Math.random()
in the generateSessionId
method with a cryptographically secure random number generator. In the browser, the recommended approach is to use window.crypto.getRandomValues
. This can be used to generate a random 32-bit integer, which can then be used in place of the insecure random value. The fix should only affect the generateSessionId
method in src/frontend/src/services/TaskService.tsx
. No changes to the method's interface or usage are required. No new dependencies are needed, as window.crypto
is available in all modern browsers.
-
Copy modified lines R104-R107
@@ -103,3 +103,6 @@ | ||
const timestamp = new Date().getTime(); | ||
const random = Math.floor(Math.random() * 10000); | ||
// Use cryptographically secure random number | ||
const array = new Uint32Array(1); | ||
window.crypto.getRandomValues(array); | ||
const random = array[0] % 10000; | ||
return `sid_${timestamp}_${random}`; |
(cherry picked from commit 8e47eb8)
🎉 This PR is included in version 2.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Purpose
Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information