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

Aberta
#262 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
25/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
java, powershell
Domínio
desktop-dev, security

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.
Linguagem predominante
Java
Estrelas
6
Forks
6
Merge médio
10h 11min
PRs com merge (30d)
12

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de JDiskMark/jdm-java

Todas as issues de JDiskMark/jdm-java

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.