Missing Authorization
The product does not perform an authorization check when an actor attempts to access a resource or perform an action.
Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource. When authorization checks are completely missing, any authenticated user can access protected resources.
इस भेद्यता को कैसे ठीक करें
3 Shoulder डिटेक्शन नियमों पर आधारित Missing Authorization के लिए रोकथाम रणनीतियाँ।
Require human approval for sensitive operations and limit agent loop iterations
- for _, toolCall := range resp.Choices[0].Message.ToolCalls { + var sensitiveOps = map[string]bool{ + "deleteUser": true, "transferFunds": true, "sendEmail": true, + } + + for i, toolCall := range resp.Choices[0].Message.ToolCalls { + if i >= maxIterations { + break + } + if sensitiveOps[toolCall.Function.Name] { + queueForApproval(toolCall) + continue + } result, _ := tools[toolCall.Function.Name](toolCall.Function.Arguments) results = append(results, result) }
अपने कोड में भेद्यताएँ खोजें
Missing Authorization पैटर्न के लिए अपने कोडबेस को स्कैन करने के लिए Shoulder का उपयोग करें। 3 नियम.
# Scan with Shoulder CLI npx @shoulderdev/cli trust --cwe=862 # Or scan entire project npx @shoulderdev/cli trust .
पहचान नियम (3)
कोड समीक्षा में किन बातों पर ध्यान दें
ये पैटर्न संभावित Missing Authorization भेद्यताओं का संकेत देते हैं। कोड समीक्षा और सुरक्षा ऑडिट के दौरान इन्हें देखें।
अपने कोडबेस को इसके लिए स्कैन करें: Missing Authorization
Shoulder CLI आपके पूरे कोडबेस में भेद्य पैटर्न खोजता है।