Windows: only elevate the SMART agent from a protected install location

Abierto
#262 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java, powershell

Línea de trabajo

Start with SmartEscalation.ensureAgentRunning() and how it gets its path from Smart.resolveSmartctlPath(), then read SmartEscalation.isProtectedLocation() as it is used in PR #261 for the cache drop path. Done means the SMART elevation path applies the same protected-location check, with the -Djdm.devElevation=true opt-in, and the design question of signature or ACL verification is settled first. Expect a maintainer decision before coding, since the issue leaves the approach open.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug windows

Found in the PR #261 review (Copilot, "Restrict elevation to verified protected installations").

Problem

SmartEscalation.ensureAgentRunning() elevates smart-agent.ps1 from wherever Smart.resolveSmartctlPath() finds smartctl.exe: jar-relative, java.home-relative, APPDIR, or system paths. Outside the MSI install (zip/portable layout, IDE target/), that folder can be user-writable, so any process could replace the script and get code run elevated when the user approves the SMART UAC prompt.

PR #261 already restricts the new cache drop use of the agent to installs under Program Files (SmartEscalation.isProtectedLocation(), dev opt-in -Djdm.devElevation=true). The existing SMART path is unchanged to avoid breaking SMART in dev runs.

Proposal
  • Apply isProtectedLocation() to SMART elevation too; outside Program Files show SMART as unavailable (or ask to run as admin), with the same dev opt-in.
  • Consider verifying the script's signature or ACL instead of the path alone.
  • Review the zip distribution plan (README: portable, run from USB) against this.
Lenguaje dominante
Java
Estrellas
6
Forks
6
Merge medio
10 h 11 min
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de JDiskMark/jdm-java

Todos los issues de JDiskMark/jdm-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.