22.09.2013 Views

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• COBW3_SANITIZE_CNV [Optional]<br />

Chapter 3. How to Use <strong>SAF</strong> <strong>Subroutines</strong> 41<br />

If characters that are vulnerable to a cross site scripting attack are found in<br />

conversion data, those characters are automatically replaced. This process is referred<br />

to as “sanitizing”.<br />

For more details on cross site scripting, refer to Appendix P, Security, in the<br />

<strong>NetCOBOL</strong> User’s <strong>Guide</strong>.<br />

COBW3_SANITIZE_CNV is valid when either COBW3_SET_REPEAT_XX or<br />

COBW3_SET_ REPEAT_NX is used. However, if the code set is Unicode,<br />

COBW3_SANITIZE_CNV is also valid when COBW3_SET_ REPEAT_XN or<br />

COBW3_SET_ REPEAT_NN is used.<br />

Condition name Value Explanation<br />

COBW3-SANITIZE-CNV-OFF LOW-VALUE Does not sanitize.<br />

COBW3-SANITIZE-CNV-ON "1" Sanitize.<br />

NOTE:<br />

The sanitization procedure replaces the five characters that are vulnerable to a cross<br />

site scripting attack (&, , “, ‘) with the following escape characters:<br />

& → &amp;<br />

< → &lt;<br />

> → &gt;<br />

" → &quot;<br />

' → &#39;<br />

As a result, a single character is being replaced with 4-6 characters, increasing the<br />

length of the sanitized data. This means that, depending on the content of the<br />

unsanitized data, sanitizing data may cause the maximum data length (1024 bytes)<br />

set in the Web parameter VALUE to be exceeded. If this happens, the sanitized data<br />

is truncated automatically at 1024 bytes.<br />

It is also possible that the escape characters themselves may be truncated. In this<br />

case, the vulnerable character is deleted, not replaced. An example is given below.<br />

Example: The unsanitized data area is 1021 bytes long. The first 1020 bytes<br />

contain n characters that do not require sanitizing, but the last character is an<br />

ampersand ( & ).<br />

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!