ベータ 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 はコードベース全体から脆弱なパターンを見つけます。