베타 Shoulder는 베타 버전입니다 — 결과가 가끔 잘못될 수 있습니다. 여러분의 피드백이 다음에 무엇을 고칠지 결정합니다. 피드백 공유

Improper Handling of Extra Parameters

🛡️ 2 개의 규칙이 이를 탐지합니다

Improper Handling of Extra Parameters

The product does not handle or incorrectly handles when the number of parameters, fields, or arguments with the same name exceeds the expected amount.

When applications receive duplicate parameters, they may process them inconsistently, leading to security bypasses or logic errors. Different frameworks may select the first, last, or combine duplicate parameters.

보급률
보통
2개 언어 지원
영향
보통
검토 권장
예방
문서화됨
2개의 수정 예시
2 예방
2 예방

이 취약점을 수정하는 방법

2개의 Shoulder 탐지 규칙을 기반으로 한 Improper Handling of Extra Parameters 예방 전략.

HTTP Parameter Pollution Prevention in Express.js LOW

Add hpp middleware to normalize duplicate query parameters

+3 -0 javascript
+ const hpp = require('hpp');
+ app.use(hpp());
+ 
  app.get('/search', (req, res) => {
    const role = req.query.role;
    if (role === 'admin') {
      res.json({ admin: true });
    }
  });
  
HTTP Parameter Pollution MEDIUM

Explicitly check for and reject duplicate HTTP parameters

+8 -7 python
- from flask import request
- 
- @app.route('/api/action')
- def action():
-     user_id = request.args.get('id')
-     # Attacker sends: ?id=1&id=admin
-     # Only gets first value, but backend proxy may use last
+ from flask import request, jsonify
+ 
+ @app.route('/api/action')
+ def action():
+     all_ids = request.args.getlist('id')
+     if len(all_ids) != 1:
+         return jsonify({'error': 'Duplicate parameters not allowed'}), 400
+     user_id = all_ids[0]
      perform_action(user_id)
  
3 탐지
3 탐지

코드에서 취약점 찾기

Shoulder를 사용하여 코드에서 Improper Handling of Extra Parameters 패턴을 스캔하세요. 2 규칙.

터미널
# Scan with Shoulder CLI
npx @shoulderdev/cli trust --cwe=235

# Or scan entire project
npx @shoulderdev/cli trust .
4 경고 신호
4 경고 신호

코드 리뷰에서 주의할 점

이 패턴은 잠재적인 Improper Handling of Extra Parameters 취약점을 나타냅니다. 코드 리뷰와 보안 감사 중에 찾아보세요.

🟡
handling of duplicate HTTP parameters without proper validation python-parameter-pollution
🔵
Request parameters used without HPP protection. Express converts duplicate query/body params to arrays, which can bypass javascript-express-hpp-prevention
🔵
missing HTTP Parameter Pollution (HPP) protection in Express javascript-express-hpp-prevention
🔍

코드베이스를 스캔하세요: Improper Handling of Extra Parameters

Shoulder CLI는 전체 코드베이스에서 취약한 패턴을 찾아냅니다.