fedora 23
format weakness #16

4

Weakness Breakdown


Definition:

A format string exploit occurs when the data of an input string is evaluated as a command by the program. This class of attacks is very similar to buffer overflows since an attacker could execute code, read the stack or cause new behaviors that compromise security. Learn more about format string attacks on OWASP attack index.

Warning code(s):

If format strings can be influenced by an attacker, they can be exploited.

File Name:

E/PCL2/pcl_idents.c

Context:

The highlighted line of code below is the trigger point of this particular Fedora 23 format weakness.

 }


/*-----------------------------------------------------------------------
//
// Function: PCLIdPrintFormatted()
//
//   Print a PCL identifier.
//
// Global Variables: -
//
// Side Effects    : Output
//
/----------------------------------------------------------------------*/

void PCLIdPrintFormatted(FILE* out, PCLId_p id, bool formatted)
{
   long i;

   assert(id);
   assert(PDArrayElementInt(id,0)>=0);
   assert(PDArrayElementInt(id,0)!=NO_PCL_ID_ELEMENT); /* Redundant,
							  bute
							  well...erm...*/ 
   fprintf(out, formatted?"%7ld":"%ld", PDArrayElementInt(id,0));
   for(i=1;PDArrayElementInt(id,i)!=NO_PCL_ID_ELEMENT;i++)
   {
      fprintf(out, ".%ld", PDArrayElementInt(id,i));
   }
}


/*-----------------------------------------------------------------------
//
// Function: PCLIdPrintTSTP()
//
//   Print a PCL identifier in a format suitable for TSTP. If a single
//   number, print it, otherwise convert it to pclid<no1>_<no2>...
//
// Global Variables: -
//
// Side Effects    : Output
//
/----------------------------------------------------------------------*/

void PCLIdPrintTSTP(FILE* out, PCLId_p id)
{
   long i;

   assert(id); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.