Fix boot CD image path validation
re.match checks only beginning of the path. There should be re.fullmatch. Fixes QubesOS/qubes-issues#4860
This commit is contained in:
		
							parent
							
								
									7874aa73fe
								
							
						
					
					
						commit
						f6c8103f46
					
				@ -167,7 +167,7 @@ def get_path_from_vm(vm, service_name):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if not untrusted_path:
 | 
					    if not untrusted_path:
 | 
				
			||||||
        return None
 | 
					        return None
 | 
				
			||||||
    if path_re.match(untrusted_path):
 | 
					    if path_re.fullmatch(untrusted_path):
 | 
				
			||||||
        assert '../' not in untrusted_path
 | 
					        assert '../' not in untrusted_path
 | 
				
			||||||
        assert '\0' not in untrusted_path
 | 
					        assert '\0' not in untrusted_path
 | 
				
			||||||
        return untrusted_path.strip()
 | 
					        return untrusted_path.strip()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user