alpine 3.7
shell weakness #14


Weakness Breakdown


A shell weakness occurs when a program enables an attacker to execute unexpected commands on the operating system.

Warning code(s):

This causes a new program to execute and is difficult to use safely.

File Name:



The highlighted line of code below is the trigger point of this particular Alpine 3.7 shell weakness.

 main (int argc, char *argv[])
  char fdbuf[80];

  if (argc != 2)
      fprintf (stderr, "usage: %s PATH-TO-FDOP\n", argv[0]);
      return 2;
  if (!O_CLOEXEC)
    return 77;
  d = gdbm_open ("file.db", 0, GDBM_NEWDB|GDBM_CLOEXEC, 0600, NULL);
  if (!d)
      fprintf (stderr, "gdbm_open: %s\n", gdbm_strerror (gdbm_errno));
      return 3;
  if (gdbm_reorganize (d))
      fprintf (stderr, "gdbm_reorganize: %s\n",
	       gdbm_strerror (gdbm_errno));
      return 3;
  execl (argv[1], "fdop",
	 ntos (gdbm_fdesc (d), fdbuf, sizeof (fdbuf)), NULL);
  return 127;

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.