Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 13db1deba7f8b798ff357f232fcc05997b38b466
Ticket: 67aa9a207037ae67f9014b544c3db34fa732f2dc
Security: Invalid UTF-8 can inject unexpected characters
User & Date: sebres on 2017-05-31 14:02:31
Changes

  1. closedate changed to: "2457905.08508066"
  2. closer changed to: "sebres"
  3. icomment:
    The security people (I hope I may say belonging to those to some extent) say - it is rather undefined behavior, but not directly a kind of vulnerability in sense of "tcl has possible security-leak with grave impact".
    
    The fact is: if you read something from foreign input and want to escape/validate it somehow, you should act in the target encoding (and never with the raw input). This is one of the first rules, that will be applied by security-audits.
    
    I mean that it should be converted previously... Or twice (before and hereafter).
    
    Just as example:
    <pre><code>
    % puts [set buf "\xc0\xbcscript ..."]
    À¼script ...
    % set buf [encoding convertfrom utf-8 $buf]; #** important before validate **
    <script ...
    % if {[regexp -nocase {<script} $buf]} {error NOT-PERMITTED}
    NOT-PERMITTED
    </code></pre>
    
    Just as some thoughts for your info. I'm doing already too much sec-audits (including the source code).
    
    Don't misunderstand my amount, I'm not with Don here (in contrary the changes looks good to me), but... But I do not see this necessarily as argument for theoretical vulnerability to fix ASAP.
    But also I don't see still any reasons to revert it ASAP.
    
  4. login: "sebres"
  5. mimetype: "text/x-fossil-wiki"