Skip to content
Tcl Source Code History Of Ticket bad6cc213dfe8280
Login

History Of Ticket bad6cc213dfe8280

Artifacts Associated With Ticket bad6cc213dfe8280

  1. Ticket change [813cbff8b7] (rid 195003) by salmonx on 2021-06-22 07:33:42:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/html"
    4. comment initialized to:
      <p>Description: The 'printf' in 'SubstituteFile' accepts a format string as an argument, but the format string originates from the argv[3] which is controlled by user.
      </p>
      <p>Fix: printf("%s", szBuffer);</p>
      
      <hr>
      <pre>
      static int
      SubstituteFile(
          const char *substitutions,
          const char *filename)
      {
          ...
      
      	/*
      	 * Run the substitutions over each line of the input
      	 */
      
      	while (fgets(szBuffer, cbBuffer, fp) != NULL) {
      	    list_item_t *p = NULL;
      	    for (p = substPtr; p != NULL; p = p->nextPtr) {
      		char *m = strstr(szBuffer, p->key);
      		if (m) {
      		    char *cp, *op, *sp;
      		    cp = szCopy;
      		    op = szBuffer;
      		    while (op != m) *cp++ = *op++;
      		    sp = p->value;
      		    while (sp && *sp) *cp++ = *sp++;
      		    op += strlen(p->key);
      		    while (*op) *cp++ = *op++;
      		    *cp = 0;
      		    memcpy(szBuffer, szCopy, sizeof(szCopy));
      		}
      	    }
      	    printf(szBuffer); // Bug is here, szBuffer can be controlled
      	}
      
      	list_free(&substPtr);
          }
          fclose(fp);
          return 0;
      }
      </pre>
      
    5. foundin initialized to: "ALL"
    6. is_private initialized to: "0"
    7. login: "salmonx"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "1e6726276a059d4157d886e633147205cbd8e399"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "salmonx"
    14. subsystem initialized to: "69. Other"
    15. title initialized to:
      A format string vulnerability in Tcl nmakehelp.c allows code execution via a crated file.
      
    16. type initialized to: "Bug"
  2. Ticket change [b905b3d21a] (rid 195009) by jan.nijtmans on 2021-06-22 09:11:53:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2459387.88325626"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      See also [https://sqlite.org/forum/forumpost/47c7eb6802]. Let's repeat the conclusion here: "This Is Not A Tcl Vulnerability"! Same arguments as DRH wrote in the SQLite forum post.
      
      That said, it's fixed here: [28ef6c0c741408a2]
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. severity changed to: "Cosmetic"
    9. status changed to: "Closed"
  3. Ticket change [686a2ddb91] (rid 195118) by jan.nijtmans on 2021-07-01 06:22:34:

    1. closedate changed to: "2459396.76567512"
    2. icomment:
      This issue has been assigned a CVE number: CVE-2021-35331
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"