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

Insertion of Sensitive Information into Log File

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

Insertion of Sensitive Information into Log File

Information written to log files can be of a sensitive nature and give valuable guidance to an attacker or expose sensitive user information.

When sensitive information like passwords, tokens, or personal data is logged, it becomes accessible to anyone with access to the logs. Log files are often stored with less security than the data they contain.

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

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

3 Shoulder डिटेक्शन नियमों पर आधारित Information Exposure Through Logs के लिए रोकथाम रणनीतियाँ।

Logging Sensitive Data MEDIUM

Never log passwords, tokens, or PII; log presence/absence instead

+1 -1 go
  func authenticateUser(username, password string) error {
-     log.Printf("Auth: user=%s password=%s", username, password)
+     log.Printf("Auth attempt: user=%s", username)
      return nil
  }
  
Sensitive Data Exposure in Logs MEDIUM

Exclude sensitive fields from logged data using destructuring or redaction

+2 -1 javascript
  app.post('/login', (req, res) => {
-   console.log('Login request:', req.body);
+   const { password, ...safeBody } = req.body;
+   logger.info('Login request:', safeBody);
  });
  
Sensitive Data in Logging HIGH

Redact sensitive fields before logging; log actions and identifiers, not credentials

+1 -1 python
  import logging
  
  logger = logging.getLogger(__name__)
  
  def login(username, password):
-     logger.info(f"Login: user={username}, password={password}")
+     logger.info(f"Login attempt for user: {username}")
      authenticate(username, password)
  
3 पहचान
3 पहचान

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

Insertion of Sensitive Information into Log File पैटर्न के लिए अपने कोडबेस को स्कैन करने के लिए Shoulder का उपयोग करें। 3 नियम.

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

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

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

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

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

ये पैटर्न संभावित Insertion of Sensitive Information into Log File भेद्यताओं का संकेत देते हैं। कोड समीक्षा और सुरक्षा ऑडिट के दौरान इन्हें देखें।

🟠
logging of sensitive data like passwords, API keys, tokens, credit cards, or authentication credenti python-sensitive-data-logging
🟡
when user-provided sensitive data (passwords, tokens, API keys, secrets, etc javascript-sensitive-data-logging
🔍

अपने कोडबेस को इसके लिए स्कैन करें: Insertion of Sensitive Information into Log File

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