MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / check_path_traversal

Method check_path_traversal

test/functional/interface_http.py:449–462  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

447
448
449 def check_path_traversal(self):
450 self.log.info("Check that path traversal attempts are safely rejected")
451 traversal_paths = [
452 '/../etc/passwd',
453 '/../../etc/shadow',
454 '/%2e%2e/%2e%2e/etc/passwd', # URL-encoded dots
455 '/..%2Fetc%2Fpasswd', # URL-encoded slash
456 '/.%2e/.%2e/etc/passwd', # mixed encoding
457 '/valid/../../../etc/passwd',
458 ]
459 for path in traversal_paths:
460 conn = BitcoinHTTPConnection(self.node)
461 response = conn.get(path)
462 assert_equal(response.status, http.client.NOT_FOUND)
463
464
465 def check_request_smuggling_cl_te(self):

Callers 1

run_testMethod · 0.95

Calls 4

getMethod · 0.95
assert_equalFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected