mirror of
https://github.com/xcat2/confluent.git
synced 2026-08-04 00:17:01 +00:00
Use basename to ensure no path traversal in license filenames
This commit is contained in:
@@ -2588,6 +2588,7 @@ class XCCClient(IMMClient):
|
||||
rsp = await wc.grab_json_response(
|
||||
'/api/providers/imm_fod', {'FOD_LicenseKeyExport': licid})
|
||||
filename = rsp.get('FileName', None)
|
||||
filename = os.path.basename(filename) if filename else None
|
||||
if filename:
|
||||
url = '/download/' + filename
|
||||
savefile = os.path.join(directory, filename)
|
||||
|
||||
@@ -1693,6 +1693,7 @@ class OEMHandler(generic.OEMHandler):
|
||||
rsp = await wc.grab_json_response(
|
||||
'/api/providers/imm_fod', {'FOD_LicenseKeyExport': licid})
|
||||
filename = rsp.get('FileName', None)
|
||||
filename = os.path.basename(filename) if filename else None
|
||||
if filename:
|
||||
url = '/download/' + filename
|
||||
savefile = os.path.join(directory, filename)
|
||||
|
||||
Reference in New Issue
Block a user