बीटा Shoulder बीटा में है — परिणाम कभी-कभी गलत हो सकते हैं। आपकी प्रतिक्रिया तय करती है कि हम आगे क्या ठीक करें। प्रतिक्रिया साझा करें
📜

Improper Certificate Validation

🛡️ 4 नियम इसे पहचानते हैं

Improper Certificate Validation

The product does not validate, or incorrectly validates, a certificate.

When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by interfering in the communication path between the host and client.

व्यापकता
मध्यम
3 भाषाएँ कवर की गईं
प्रभाव
उच्च
4 उच्च गंभीरता वाले नियम
रोकथाम
प्रलेखित
4 फिक्स उदाहरण
2 रोकथाम
2 रोकथाम

इस भेद्यता को कैसे ठीक करें

4 Shoulder डिटेक्शन नियमों पर आधारित Improper Certificate Validation के लिए रोकथाम रणनीतियाँ।

Insecure TLS/SSL Configuration HIGH

Use TLS 1.2+ minimum version and always verify certificates

+2 -1 go
  client := &http.Client{
      Transport: &http.Transport{
          TLSClientConfig: &tls.Config{
-             InsecureSkipVerify: true,
+             MinVersion:         tls.VersionTLS12,
+             InsecureSkipVerify: false,
          },
      },
  }
  
Insecure TLS/SSL Configuration HIGH

Keep certificate verification enabled and enforce TLS 1.2 or higher

+2 -1 javascript
  const agent = new https.Agent({
-   rejectUnauthorized: false
+   rejectUnauthorized: true,
+   minVersion: 'TLSv1.2'
  });
  
SSL/TLS Certificate Validation Disabled HIGH

Keep SSL certificate verification enabled; use custom CA bundles for internal certs

+5 -1 python
  import requests
  
- response = requests.get('https://api.example.com', verify=False)
+ # Default verification (recommended)
+ response = requests.get('https://api.example.com')
+ 
+ # Custom CA for internal services
+ response = requests.get('https://internal.example.com', verify='/path/to/ca-bundle.crt')
  
SSL/TLS Certificate Verification Disabled HIGH

Keep SSL verification enabled (the default) or use custom CA bundles

+5 -1 python
  import requests
  
- response = requests.get(url, verify=False)
+ # Default: verify=True
+ response = requests.get(url, verify=True, timeout=10)
+ 
+ # For custom CA certificates:
+ response = requests.get(url, verify='/path/to/ca-bundle.crt')
  
3 पहचान
3 पहचान

अपने कोड में भेद्यताएँ खोजें

Improper Certificate Validation पैटर्न के लिए अपने कोडबेस को स्कैन करने के लिए Shoulder का उपयोग करें। 4 नियम.

टर्मिनल
# Scan with Shoulder CLI
npx @shoulderdev/cli trust --cwe=295

# Or scan entire project
npx @shoulderdev/cli trust .

पहचान नियम (4)

4 चेतावनी संकेत
4 चेतावनी संकेत

कोड समीक्षा में किन बातों पर ध्यान दें

ये पैटर्न संभावित Improper Certificate Validation भेद्यताओं का संकेत देते हैं। कोड समीक्षा और सुरक्षा ऑडिट के दौरान इन्हें देखें।

🟠
TLS configuration disables security features or uses weak settings go-insecure-tls-config
🟠
insecure TLS/SSL configurations in Node javascript-insecure-tls-config
🟠
disabled SSL/TLS certificate validation python-certificate-validation-bypass
🔍

अपने कोडबेस को इसके लिए स्कैन करें: Improper Certificate Validation

Shoulder CLI आपके पूरे कोडबेस में भेद्य पैटर्न खोजता है।