Coder Social home page Coder Social logo

code_scanning_hackathon's Introduction

code_scanning_hackathon's People

Contributors

abhimeda avatar danielsu-amd avatar

Watchers

 avatar

Forkers

abhinavmeda

code_scanning_hackathon's Issues

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " framework.BaseDebugWrapperSession.init(\n",
"1": " self, sess, thread_name_filter=thread_name_filter)\n",
"2": "\n",
"3": " if not dump_root:\n",
"4": " self._dump_root = tempfile.mktemp(prefix=_DUMP_ROOT_PREFIX)\n",
"5": " else:\n",
"6": " dump_root = os.path.expanduser(dump_root)\n",
"7": " if os.path.isfile(dump_root):\n",
"8": " raise ValueError("dump_root path points to a file: %s" % dump_root)\n",
"9": " elif os.path.isdir(dump_root) and os.listdir(dump_root):\n",
"10": " raise ValueError("dump_root path points to a non-empty directory: %s" %\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": "class DebugDumpDirTest(test_util.TensorFlowTestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._dump_root = tempfile.mktemp()\n",
"5": " os.mkdir(self._dump_root)\n",
"6": "\n",
"7": " def tearDown(self):\n",
"8": " # Tear down temporary dump directory.\n",
"9": " file_io.delete_recursively(self._dump_root)\n",
"10": "\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": "class CommandHistoryTest(test_util.TensorFlowTestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._history_file_path = tempfile.mktemp()\n",
"5": " self._cmd_hist = debugger_cli_common.CommandHistory(\n",
"6": " limit=3, history_file_path=self._history_file_path)\n",
"7": "\n",
"8": " def tearDown(self):\n",
"9": " if os.path.isfile(self._history_file_path):\n",
"10": " os.remove(self._history_file_path)\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " gpu_1_dir, "node_foo_1_2_DebugIdentity_1472563253536387"), "wb")\n",
"1": "\n",
"2": " def testDebugDumpDir_nonexistentDumpRoot(self):\n",
"3": " with self.assertRaisesRegexp(IOError, "does not exist"):\n",
"4": " debug_data.DebugDumpDir(tempfile.mktemp() + "_foo")\n",
"5": "\n",
"6": " def testDebugDumpDir_invalidFileNamingPattern(self):\n",
"7": " # File name with too few underscores should lead to an exception.\n",
"8": " device_dir = os.path.join(\n",
"9": " self._dump_root,\n",
"10": " debug_data.METADATA_FILE_PREFIX + debug_data.DEVICE_TAG +\n"
}

CodeQL Analysis Report - binds a socket to all interfaces.

Error at index 4 in
{
"0": " try:\n",
"1": " s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n",
"2": " except IOError:\n",
"3": " s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\n",
"4": " s.bind(("", 0))\n",
"5": " port = s.getsockname()[1]\n",
"6": " s.close()\n",
"7": " return port\n",
"8": "\n",
"9": " port1 = get_open_port()\n",
"10": " port2 = get_open_port()\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": "class DebugDumpDirTest(test_util.TensorFlowTestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._dump_root = tempfile.mktemp()\n",
"5": " os.mkdir(self._dump_root)\n",
"6": "\n",
"7": " def tearDown(self):\n",
"8": " # Tear down temporary dump directory.\n",
"9": " shutil.rmtree(self._dump_root)\n",
"10": "\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Error at index 4 in [' try:\n', ' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n', ' except IOError:\n', ' s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\n', ' s.bind(("", 0))\n', ' port = s.getsockname()[1]\n', ' s.close()\n', ' return port\n', '\n', ' port1 = get_open_port()\n', ' port2 = get_open_port()\n']

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " shutil.rmtree(self._dump_root)\n",
"1": "\n",
"2": " def testDebugDumpDir_nonexistentDumpRoot(self):\n",
"3": " with self.assertRaisesRegexp(IOError, "does not exist"):\n",
"4": " debug_data.DebugDumpDir(tempfile.mktemp() + "_foo")\n",
"5": "\n",
"6": " def testDebugDumpDir_invalidFileNamingPattern(self):\n",
"7": " # File name with too few underscores should lead to an exception.\n",
"8": " open(os.path.join(self._dump_root, "node1_DebugIdentity_1234"), "wb")\n",
"9": "\n",
"10": " with self.assertRaisesRegexp(ValueError,\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": "class CheckpointConvertTest(test.TestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._old_ckpt_path = tempfile.mktemp()\n",
"5": " self._new_ckpt_path = tempfile.mktemp()\n",
"6": " ops.reset_default_graph()\n",
"7": "\n",
"8": " def tearDown(self):\n",
"9": " for file_name in glob.glob(self._old_ckpt_path + "*"):\n",
"10": " os.remove(file_name)\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Error at index 4 in
[
try:,
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM),
except IOError:,
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM),
s.bind(("", 0)),
port = s.getsockname()[1],
s.close(),
return port,
,
port1 = get_open_port(),
port2 = get_open_port()
]

CodeQL Analysis Report - This file extraction depends on a [potentially untrusted source](1).

Vulnerability at index 4 in
{
"0": " _progress)\n",
"1": " print()\n",
"2": " statinfo = os.stat(filepath)\n",
"3": " print('Successfully downloaded', filename, statinfo.st_size, 'bytes.')\n",
"4": " tarfile.open(filepath, 'r:gz').extractall(dest_directory)\n",
"5": "\n",
"6": "\n",
"7": "def ensure_dir_exists(dir_name):\n",
"8": " """Makes sure the folder exists on disk.\n",
"9": "\n",
"10": " Args:\n"
}

CodeQL Analysis Report - binds a socket to all interfaces.

Error at index 4 in
{0: ' try:\n', 1: ' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n', 2: ' except IOError:\n', 3: ' s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\n', 4: ' s.bind(("", 0))\n', 5: ' port = s.getsockname()[1]\n', 6: ' s.close()\n', 7: ' return port\n', 8: '\n', 9: ' port1 = get_open_port()\n', 10: ' port2 = get_open_port()\n'}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Error at index 4 in
[
try:,
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM),
except IOError:,
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM),
s.bind(("", 0)),
port = s.getsockname()[1],
s.close(),
return port,
,
port1 = get_open_port(),
port2 = get_open_port()
]

CodeQL Analysis Report - binds a socket to all interfaces.

Error at index 4 in
[

try:,

``````python
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM),

``````python
except IOError:,

``````python
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM),

``````python
s.bind(("", 0)),

``````python
port = s.getsockname()[1],

``````python
s.close(),

``````python
return port,

``````python
,

``````python
port1 = get_open_port(),

``````python
port2 = get_open_port()
]

CodeQL Analysis Report - This file extraction depends on a [potentially untrusted source](1).

Vulnerability at index 4 in
{
"0": " if not (gfile.Exists(train_path) and gfile.Exists(test_path)):\n",
"1": " archive_path = base.maybe_download(\n",
"2": " 'dbpedia_csv.tar.gz', data_dir, DBPEDIA_URL)\n",
"3": " tfile = tarfile.open(archive_path, 'r:*')\n",
"4": " tfile.extractall(data_dir)\n",
"5": "\n",
"6": "\n",
"7": "def load_dbpedia(size='small', test_with_fake_data=False):\n",
"8": " """Get DBpedia datasets from CSV files."""\n",
"9": " if not test_with_fake_data:\n",
"10": " data_dir = os.path.join(os.getenv('TF_EXP_BASE_DIR', ''), 'dbpedia_data')\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Vulnerability at index 4 in
{
"0": " try:\n",
"1": " s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n",
"2": " except IOError:\n",
"3": " s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\n",
"4": " s.bind(("", 0))\n",
"5": " port = s.getsockname()[1]\n",
"6": " s.close()\n",
"7": " return port\n",
"8": "\n",
"9": " port1 = get_open_port()\n",
"10": " port2 = get_open_port()\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Vulnerability at index 4 in
{
"0": " try:\n",
"1": " s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n",
"2": " except IOError:\n",
"3": " s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\n",
"4": " s.bind(("", 0))\n",
"5": " port = s.getsockname()[1]\n",
"6": " s.close()\n",
"7": " return port\n",
"8": "\n",
"9": " port1 = get_open_port()\n",
"10": " port2 = get_open_port()\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " self.assertEqual(["ERROR: Redirect file path is empty"], ui.toasts)\n",
"1": " self.assertEqual(0, len(ui.unwrapped_outputs))\n",
"2": "\n",
"3": " def testAppendingRedirectErrors(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2 >> %s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " self.assertEqual(["ERROR: Redirect file path is empty"], ui.toasts)\n",
"1": " self.assertEqual(0, len(ui.unwrapped_outputs))\n",
"2": "\n",
"3": " def testAppendingRedirectErrors(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2 >> %s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " ui.toasts[4])\n",
"1": " self.assertEqual("ERROR: Empty indices.", ui.toasts[6])\n",
"2": "\n",
"3": " def testWriteScreenOutputToFileWorks(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2>%s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " ui.toasts[4])\n",
"1": " self.assertEqual("ERROR: Empty indices.", ui.toasts[6])\n",
"2": "\n",
"3": " def testWriteScreenOutputToFileWorks(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2>%s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " ui.toasts[4])\n",
"1": " self.assertEqual("ERROR: Empty indices.", ui.toasts[6])\n",
"2": "\n",
"3": " def testWriteScreenOutputToFileWorks(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2>%s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": "class CommandHistoryTest(test_util.TensorFlowTestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._history_file_path = tempfile.mktemp()\n",
"5": " self._cmd_hist = debugger_cli_common.CommandHistory(\n",
"6": " limit=3, history_file_path=self._history_file_path)\n",
"7": "\n",
"8": " def tearDown(self):\n",
"9": " if os.path.isfile(self._history_file_path):\n",
"10": " os.remove(self._history_file_path)\n"
}

CodeQL Analysis Report - Insecure SSL/TLS protocol version TLSv1 allowed by [call to ssl.SSLContext](1). Insecure SSL/TLS protocol version TLSv1_1 allowed by [call to ssl.SSLContext](1).

Vulnerability at index 4 in
{
"0": "\n",
"1": " if certfile is not None:\n",
"2": " context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n",
"3": " context.load_cert_chain(certfile, keyfile, password)\n",
"4": " self.sock = context.wrap_socket(self.sock)\n",
"5": " else:\n",
"6": " if keyfile is not None:\n",
"7": " raise ValueError("SSL is disabled, keyfile must not be specified "\n",
"8": " "(to enable SSL specify certfile)")\n",
"9": " if password is not None:\n",
"10": " raise ValueError("SSL is disabled, password must not be specified "\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": "class DebugDumpDirTest(test_util.TensorFlowTestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._dump_root = tempfile.mktemp()\n",
"5": " os.mkdir(self._dump_root)\n",
"6": "\n",
"7": " def tearDown(self):\n",
"8": " # Tear down temporary dump directory.\n",
"9": " file_io.delete_recursively(self._dump_root)\n",
"10": "\n"
}

CodeQL Analysis Report - This file extraction depends on a [potentially untrusted source](1). This file extraction depends on a [potentially untrusted source](1).

Vulnerability at index 4 in
{
"0": "\n",
"1": " if is_match_fn(file_path):\n",
"2": " with open_fn(file_path) as archive:\n",
"3": " try:\n",
"4": " archive.extractall(path)\n",
"5": " except (tarfile.TarError, RuntimeError, KeyboardInterrupt):\n",
"6": " if os.path.exists(path):\n",
"7": " if os.path.isfile(path):\n",
"8": " os.remove(path)\n",
"9": " else:\n",
"10": " shutil.rmtree(path)\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " ui.toasts[4])\n",
"1": " self.assertEqual("ERROR: Empty indices.", ui.toasts[6])\n",
"2": "\n",
"3": " def testWriteScreenOutputToFileWorks(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2>%s\n" % output_path),\n"
}

CodeQL Analysis Report - binds a socket to all interfaces.

Error at index 4 in
###[
try:,
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM),
except IOError:,
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM),
s.bind(("", 0)),
port = s.getsockname()[1],
s.close(),
return port,
,
port1 = get_open_port(),
port2 = get_open_port()
]

CodeQL Analysis Report - '' binds a socket to all interfaces.

Error at index 4
in [' try:\n', ' s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n', ' except IOError:\n', ' s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\n', ' s.bind(("", 0))\n', ' port = s.getsockname()[1]\n', ' s.close()\n', ' return port\n', '\n', ' port1 = get_open_port()\n', ' port2 = get_open_port()\n']

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": " # Override the default path to the command history file to avoid test\n",
"2": " # concurrency issues.\n",
"3": " self._command_history_store = debugger_cli_common.CommandHistory(\n",
"4": " history_file_path=tempfile.mktemp())\n",
"5": "\n",
"6": " # Below, override the screen prefixed member methods that interact with the\n",
"7": " # actual terminal, so that the mock can run in a terminal-less environment.\n",
"8": "\n",
"9": " # TODO(cais): Search for a way to have a mock terminal object that behaves\n",
"10": " # like the actual terminal, so that we can test the terminal interaction\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Error at index 4 in
[
try:,
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM),
except IOError:,
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM),
s.bind(("", 0)),
port = s.getsockname()[1],
s.close(),
return port,
,
port1 = get_open_port(),
port2 = get_open_port()
]

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": "class LocalCLIDebugWrapperSessionTest(test_util.TensorFlowTestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._tmp_dir = tempfile.mktemp()\n",
"5": "\n",
"6": " self.v = variables.Variable(10.0, name="v")\n",
"7": " self.w = variables.Variable(21.0, name="w")\n",
"8": " self.delta = constant_op.constant(1.0, name="delta")\n",
"9": " self.inc_v = state_ops.assign_add(self.v, self.delta, name="inc_v")\n",
"10": "\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": " # Override the default path to the command history file to avoid test\n",
"2": " # concurrency issues.\n",
"3": " self._command_history_store = debugger_cli_common.CommandHistory(\n",
"4": " history_file_path=tempfile.mktemp())\n",
"5": "\n",
"6": " # Below, override the screen prefixed member methods that interact with the\n",
"7": " # actual terminal, so that the mock can run in a terminal-less environment.\n",
"8": "\n",
"9": " # TODO(cais): Search for a way to have a mock terminal object that behaves\n",
"10": " # like the actual terminal, so that we can test the terminal interaction\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " source_utils.annotate_source(self.dump, self.curr_file_path)\n",
"1": "\n",
"2": " def testCallingAnnotateSourceOnUnrelatedSourceFileDoesNotError(self):\n",
"3": " # Create an unrelated source file.\n",
"4": " unrelated_source_path = tempfile.mktemp()\n",
"5": " with open(unrelated_source_path, "wt") as source_file:\n",
"6": " source_file.write("print('hello, world')\n")\n",
"7": "\n",
"8": " self.assertEqual(\n",
"9": " {}, source_utils.annotate_source(self.dump, unrelated_source_path))\n",
"10": "\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " ["Roses are red", "Violets are blue"],\n",
"1": " font_attr_segs={0: [(0, 5, "red")],\n",
"2": " 1: [(0, 7, "blue")]})\n",
"3": "\n",
"4": " file_path = tempfile.mktemp()\n",
"5": " screen_output.write_to_file(file_path)\n",
"6": "\n",
"7": " with gfile.Open(file_path, "r") as f:\n",
"8": " self.assertEqual("Roses are red\nViolets are blue\n", f.read())\n",
"9": "\n",
"10": " # Clean up.\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Error at index 4 in
[ try:

    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

  except IOError:

    s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)

  s.bind(("", 0))

  port = s.getsockname()[1]

  s.close()

  return port



port1 = get_open_port()

port2 = get_open_port()

]

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " ["Roses are red", "Violets are blue"],\n",
"1": " font_attr_segs={0: [(0, 5, "red")],\n",
"2": " 1: [(0, 7, "blue")]})\n",
"3": "\n",
"4": " file_path = tempfile.mktemp()\n",
"5": " screen_output.write_to_file(file_path)\n",
"6": "\n",
"7": " with gfile.Open(file_path, "r") as f:\n",
"8": " self.assertEqual("Roses are red\nViolets are blue\n", f.read())\n",
"9": "\n",
"10": " # Clean up.\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "@test_util.run_v1_only("b/120545219")\n",
"1": "class LocalCLIDebugWrapperSessionTest(test_util.TensorFlowTestCase):\n",
"2": "\n",
"3": " def setUp(self):\n",
"4": " self._tmp_dir = tempfile.mktemp()\n",
"5": "\n",
"6": " self.v = variables.VariableV1(10.0, name="v")\n",
"7": " self.w = variables.VariableV1(21.0, name="w")\n",
"8": " self.delta = constant_op.constant(1.0, name="delta")\n",
"9": " self.inc_v = state_ops.assign_add(self.v, self.delta, name="inc_v")\n",
"10": "\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " self.assertEqual(["ERROR: Redirect file path is empty"], ui.toasts)\n",
"1": " self.assertEqual(0, len(ui.unwrapped_outputs))\n",
"2": "\n",
"3": " def testAppendingRedirectErrors(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2 >> %s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " self.assertTrue((expected + "\n") in printed.contents())\n",
"1": "\n",
"2": " @test_util.run_in_graph_and_eager_modes()\n",
"3": " def testPrintTensorsToFile(self):\n",
"4": " tmpfile_name = tempfile.mktemp(".printv2_test")\n",
"5": " tensor_0 = math_ops.range(0, 10)\n",
"6": " print_op_0 = logging_ops.print_v2(tensor_0,\n",
"7": " output_stream="file://"+tmpfile_name)\n",
"8": " self.evaluate(print_op_0)\n",
"9": " tensor_1 = math_ops.range(11, 20)\n",
"10": " print_op_1 = logging_ops.print_v2(tensor_1,\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "class CheckpointConvertTest(test.TestCase):\n",
"1": "\n",
"2": " def setUp(self):\n",
"3": " self._old_ckpt_path = tempfile.mktemp()\n",
"4": " self._new_ckpt_path = tempfile.mktemp()\n",
"5": " ops.reset_default_graph()\n",
"6": "\n",
"7": " def tearDown(self):\n",
"8": " for file_name in glob.glob(self._old_ckpt_path + ""):\n",
"9": " os.remove(file_name)\n",
"10": " for file_name in glob.glob(self._new_ckpt_path + "
"):\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": " # Override the default path to the command history file to avoid test\n",
"2": " # concurrency issues.\n",
"3": " self._command_history_store = debugger_cli_common.CommandHistory(\n",
"4": " history_file_path=tempfile.mktemp())\n",
"5": "\n",
"6": " # Below, override the screen prefixed member methods that interact with the\n",
"7": " # actual terminal, so that the mock can run in a terminal-less environment.\n",
"8": "\n",
"9": " # TODO(cais): Search for a way to have a mock terminal object that behaves\n",
"10": " # like the actual terminal, so that we can test the terminal interaction\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Error at index 4 in
[
try:,
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM),
except IOError:,
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM),
s.bind(("", 0)),
port = s.getsockname()[1],
s.close(),
return port,
,
port1 = get_open_port(),
port2 = get_open_port()
]

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " self.assertEqual(["ERROR: Redirect file path is empty"], ui.toasts)\n",
"1": " self.assertEqual(0, len(ui.unwrapped_outputs))\n",
"2": "\n",
"3": " def testAppendingRedirectErrors(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2 >> %s\n" % output_path),\n"
}

CodeQL Analysis Report - '' binds a socket to all interfaces.

Vulnerability at index 4 in
{
"0": " try:\n",
"1": " s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n",
"2": " except IOError:\n",
"3": " s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)\n",
"4": " s.bind(("", 0))\n",
"5": " port = s.getsockname()[1]\n",
"6": " s.close()\n",
"7": " return port\n",
"8": "\n",
"9": " port1 = get_open_port()\n",
"10": " port2 = get_open_port()\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " ui.toasts[4])\n",
"1": " self.assertEqual("ERROR: Empty indices.", ui.toasts[6])\n",
"2": "\n",
"3": " def testWriteScreenOutputToFileWorks(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2>%s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " self.assertEqual(["ERROR: Redirect file path is empty"], ui.toasts)\n",
"1": " self.assertEqual(0, len(ui.unwrapped_outputs))\n",
"2": "\n",
"3": " def testAppendingRedirectErrors(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockCursesUI(\n",
"7": " 40,\n",
"8": " 80,\n",
"9": " command_sequence=[\n",
"10": " string_to_codes("babble -n 2 >> %s\n" % output_path),\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": "\n",
"1": " framework.BaseDebugWrapperSession.init(self, sess)\n",
"2": "\n",
"3": " if not dump_root:\n",
"4": " self._dump_root = tempfile.mktemp(prefix=_DUMP_ROOT_PREFIX)\n",
"5": " else:\n",
"6": " if os.path.isfile(dump_root):\n",
"7": " raise ValueError("dump_root path points to a file: %s" % dump_root)\n",
"8": " elif os.path.isdir(dump_root) and os.listdir(dump_root):\n",
"9": " raise ValueError("dump_root path points to a non-empty directory: %s" %\n",
"10": " dump_root)\n"
}

CodeQL Analysis Report - Call to deprecated function tempfile.mktemp may be insecure.

Vulnerability at index 4 in
{
"0": " self.assertEqual(0, len(ui.observers["screen_outputs"]))\n",
"1": " self.assertTrue(observer["callback_invoked"])\n",
"2": "\n",
"3": " def testIncompleteRedirectWorks(self):\n",
"4": " output_path = tempfile.mktemp()\n",
"5": "\n",
"6": " ui = MockReadlineUI(\n",
"7": " command_sequence=["babble -n 2 > %s" % output_path, "exit"])\n",
"8": "\n",
"9": " ui.register_command_handler("babble", self._babble, "")\n",
"10": " ui.run_ui()\n"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.