下流のコンポーネントへの出力を生成する際に、製品がエンコーディングを使用または指定しているが、指定されたエンコーディングが、下流のコンポーネントが期待するエンコーディングと異なる。
この弱点により、下流のコンポーネントが、製品が送信しようと意図したものとは異なるデータを生成するデコード方法を使用する可能性がある。間違ったエンコーディングが使用された場合、たとえ密接に関連していたとしても、下流のコンポーネントはデータを間違ってデコードしてしまう可能性があります。これは、制御とデータの間の境界が不注意に破られた場合、製品から送信されたのではない制御文字や特殊な要素を含むデータが生成される可能性があるため、セキュリティに影響を及ぼす可能性があります。その結果、入力検証のような保護メカニズムを迂回し、インジェクション攻撃を可能にするために、そのデータが使用される可能性があります。
出力エンコーディングを使用することは、コンポーネント間の通信が正確であることを保証するために不可欠ですが、間違ったエンコーディングを使用すると、たとえ密接に関連していたとしても、下流のコンポーネントが出力を誤って解釈する可能性があります。
例えば、HTMLのエンティティ・エンコーディングは、ウェブページのHTMLボディの要素に使用される。しかし、プログラマーは、HTMLタグの属性内で使用される出力を生成する際にエンティティ・エンコーディングを使用するかもしれません。
この問題で最も注目されているのはウェブ・アプリケーションですが、この弱点は、複数のエンコーディングをサポートする可能性のある通信ストリームを使用するあらゆるタイプの製品に適用される可能性があります。
The product uses or specifies an encoding when generating output to a downstream component, but the specified encoding is not the same as the encoding that is expected by the downstream component.
This weakness can cause the downstream component to use a decoding method that produces different data than what the product intended to send. When the wrong encoding is used - even if closely related - the downstream component could decode the data incorrectly. This can have security consequences when the provided boundaries between control and data are inadvertently broken, because the resulting data could introduce control characters or special elements that were not sent by the product. The resulting data could then be used to bypass protection mechanisms such as input validation, and enable injection attacks.
While using output encoding is essential for ensuring that communications between components are accurate, the use of the wrong encoding - even if closely related - could cause the downstream component to misinterpret the output.
For example, HTML entity encoding is used for elements in the HTML body of a web page. However, a programmer might use entity encoding when generating output for that is used within an attribute of an HTML tag, which could contain functional Javascript that is not affected by the HTML encoding.
While web applications have received the most attention for this problem, this weakness could potentially apply to any type of product that uses a communications stream that could support multiple encodings.