v0.207.0 — R-249: the retrieval passphrase leaves the page body; R-252/R-253: two refusals learn to say what to do
gates / gates (push) Successful in 18s
gates / gates (push) Successful in 18s
R-249. settings_security.html rendered the passphrase into a display:none span behind a Megjelenit button. That toggle stops a browser DRAWING the value and nothing else — the plaintext was in the response body of every render, so a curl of the page returned it. Found by exactly that: it landed in a session transcript while driving the documented rebuild path. The codebase already stated this rule for the recovery code and this page did not follow it (escrow_handlers.go: 'reveal (claim XHR only — R is NEVER templated server-side into HTML)'). The page now carries only HasRetrievalPassword; the value comes from POST /settings/retrieval-password/reveal — CSRF-covered because POST, no-store, and LOGGED as an act, which reading it off the markup never was. The tests assert the RAW RESPONSE BODY. Every test that asked what the customer sees passed while the bytes carried the secret; that is why this survived. Census: the render-then-hide pattern appears twice more — app_info.html (a real per-install app password in a hidden span) and deploy.html. Filed as R-254, NOT fixed here. R-252. A rebuilt box keeps its drives but loses their REGISTRATION. The restore page now states that before the customer presses anything, says the backups and drives are both still there, and links to Tarhely > Meghajtok. Page and resolver ask ONE question — HasRestoreDestination() reads the same GetSchedulableStoragePaths() the scratch resolver reads. R-253. The list promised 'a visszaallitas elobb ujratelepiti' three lines above a refusal that fired BECAUSE the app was not installed. The promise was the wrong half: reconstitution writes to the app's own GetStackHDDPath, which exists only once the CUSTOMER has chosen a drive at deploy time. Auto-reinstalling would mean the product making that choice for them. Copy now says to install first and routes to /stacks/<app>/deploy. Both notices are conditional — a healthy box renders as before, pinned by a test that fails if either becomes unconditional.
This commit is contained in:
@@ -405,7 +405,7 @@ function openDialog(opts){
|
||||
</script>
|
||||
|
||||
<!-- Section: Recovery Info -->
|
||||
{{if .RetrievalPassword}}
|
||||
{{if .HasRetrievalPassword}}
|
||||
<div class="settings-card">
|
||||
<h3>Vészhelyzeti információk</h3>
|
||||
<p class="settings-card-desc">
|
||||
@@ -422,14 +422,13 @@ function openDialog(opts){
|
||||
</div>
|
||||
<div class="settings-row">
|
||||
<span class="settings-label">Visszaállítási jelszó</span>
|
||||
<!-- R-249: the value is NOT in this page. The old markup rendered it into a
|
||||
display:none span, which hid it from the eye and from nothing else — a fetch of the
|
||||
page returned the plaintext. „Megjelenít" now asks the server for it. -->
|
||||
<span class="settings-value">
|
||||
<span id="retrieval-pw-hidden">••••••••••••••••
|
||||
<button type="button" class="btn btn-xs btn-outline" onclick="document.getElementById('retrieval-pw-hidden').style.display='none';document.getElementById('retrieval-pw-visible').style.display='inline';">Megjelenít</button>
|
||||
</span>
|
||||
<span id="retrieval-pw-visible" style="display:none">
|
||||
<code class="mono">{{.RetrievalPassword}}</code>
|
||||
<button type="button" class="btn btn-xs btn-outline" onclick="document.getElementById('retrieval-pw-visible').style.display='none';document.getElementById('retrieval-pw-hidden').style.display='inline';">Elrejt</button>
|
||||
</span>
|
||||
<span id="retrieval-pw-slot" class="mono">••••••••••••••••</span>
|
||||
<button type="button" id="retrieval-pw-btn" class="btn btn-xs btn-outline" onclick="revealRetrievalPw()">Megjelenít</button>
|
||||
<span id="retrieval-pw-err" class="form-hint" style="display:none;color:var(--red)"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="settings-row">
|
||||
@@ -442,6 +441,42 @@ function openDialog(opts){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// R-249: fetch the passphrase on demand. The page itself never contains it, so this is the only
|
||||
// way it reaches a browser — and it takes a live session plus the CSRF token bound to it.
|
||||
function revealRetrievalPw() {
|
||||
var slot = document.getElementById('retrieval-pw-slot');
|
||||
var btn = document.getElementById('retrieval-pw-btn');
|
||||
var err = document.getElementById('retrieval-pw-err');
|
||||
err.style.display = 'none';
|
||||
if (btn.dataset.shown === '1') { // „Elrejt" — drop the value out of the DOM again
|
||||
slot.textContent = '••••••••••••••••';
|
||||
btn.textContent = 'Megjelenít';
|
||||
btn.dataset.shown = '';
|
||||
return;
|
||||
}
|
||||
btn.disabled = true;
|
||||
fetch('/settings/retrieval-password/reveal', {
|
||||
method: 'POST',
|
||||
headers: {'X-CSRF-Token': '{{.CSRFToken}}'},
|
||||
credentials: 'same-origin'
|
||||
}).then(function (r) { return r.json(); }).then(function (j) {
|
||||
btn.disabled = false;
|
||||
if (!j.ok) {
|
||||
err.textContent = j.error || 'A visszaállítási jelszó lekérése nem sikerült.';
|
||||
err.style.display = 'inline';
|
||||
return;
|
||||
}
|
||||
slot.textContent = j.data.password;
|
||||
btn.textContent = 'Elrejt';
|
||||
btn.dataset.shown = '1';
|
||||
}).catch(function () {
|
||||
btn.disabled = false;
|
||||
err.textContent = 'A visszaállítási jelszó lekérése nem sikerült.';
|
||||
err.style.display = 'inline';
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{{end}}
|
||||
{{template "layout_end" .}}
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user