mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-14 23:43:23 -05:00
fix: hold manifest paths inside the trust boundary
Every other manifest field was treated as hostile input, but standalone_copies targets were only length-checked before being expanded and written to: a traversal component or a symlink already sitting at the destination sent the copy outside the directory the user opted into. Targets are now validated like the other paths and a symlinked destination is never followed. RETROBIOS_BASE_URL serves the manifest and the files it declares, so it now has to be HTTPS the way both bootstraps already require of the installer URL; loopback stays open for the end-to-end tests. install.ps1 left TLS at the Windows PowerShell 5.1 default, which GitHub refuses, so the download failed before any hash was checked. check_local read every file once per declared digest, single threaded. One read now feeds both, across the same pool the downloads use. RetroPie had no manifest, so the one-line installer answered 'unknown platform' for a frontend whose packs do ship.
This commit is contained in:
1 parent
958b988015
commit
185cf47bbc
5 files changed
+16676
-52
No files matched your search
+8
-1
@@ -8,7 +8,7 @@ param(
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
|
||||
$defaultInstallSha256 = "79630030c1b7445e2df02bcf0272c4530d24827b2589780b214489ab036d2e8c"
|
||||
$defaultInstallSha256 = "b83e7422b8516d666017964cf18fc9ef8c4f8bbdb6a594ed9da0c04158eff870"
|
||||
$maximumInstallerBytes = 2MB
|
||||
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
|
||||
$temporary = $null
|
||||
@@ -24,6 +24,13 @@ try {
|
||||
if ($expected -notmatch '^[0-9a-fA-F]{64}$') {
|
||||
throw "Installer SHA-256 must contain exactly 64 hexadecimal characters."
|
||||
}
|
||||
# Windows PowerShell 5.1 still negotiates SSL 3.0 / TLS 1.0 by default
|
||||
# and GitHub refuses both, so the download fails before any hash is
|
||||
# checked. install.sh pins the same floor with curl --tlsv1.2.
|
||||
if ($PSVersionTable.PSEdition -ne "Core") {
|
||||
[Net.ServicePointManager]::SecurityProtocol = `
|
||||
[Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
|
||||
}
|
||||
$temporary = Join-Path ([IO.Path]::GetTempPath()) ("retrobios-install-{0}.py" -f [Guid]::NewGuid())
|
||||
Invoke-WebRequest -Uri $uri -OutFile $temporary -UseBasicParsing
|
||||
if ((Get-Item -LiteralPath $temporary).Length -gt $maximumInstallerBytes) {
|
||||
|
||||
Reference in new issue
Block a user