| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| openpublisher5_amd64-windows-portable.exe | 2026-09-30 | 183.2 MB | |
| openpublisher5_amd64-windows.exe | 2026-09-30 | 165.2 MB | |
| openpublisher5_amd64-macos.dmg | 2026-09-30 | 233.1 MB | |
| openpublisher5_amd64-linux.run | 2026-09-30 | 193.4 MB | |
| openpublisher5_amd64-linux.rpm | 2026-09-30 | 215.4 MB | |
| openpublisher5_amd64-linux.flatpak | 2026-09-30 | 153.6 MB | |
| openpublisher5_amd64-linux.deb | 2026-09-30 | 156.2 MB | |
| openpublisher5_amd64-linux.AppImage | 2026-09-30 | 176.6 MB | |
| openpublisher5_amd64-freebsd.pkg | 2026-09-30 | 185.5 MB | |
| 5.1.10_ Desktop App Password Encryption _ Metadata Bridge source code.tar.gz | 2026-09-30 | 21.5 MB | |
| 5.1.10_ Desktop App Password Encryption _ Metadata Bridge source code.zip | 2026-09-30 | 21.7 MB | |
| README.md | 2026-09-30 | 6.4 kB | |
| Totals: 12 Items | 1.7 GB | 0 | |
π Summary
Version 5.1.10 fixes a critical issue where password-protected documents saved inside the V5 desktop application (wrapper.html) failed to retain encryption, causing saved .opub publications to reopen without prompting for a password.
This fix is implemented entirely within the web application codebase, eliminating the need to rebuild, recompile, or redistribute desktop application installers across Windows, macOS, Linux, and FreeBSD.
π Root Cause Analysis
When running inside the V5 desktop application wrapper (wrapper.html), an injection timer periodically injected an unencrypted stub for saveDocument:
:::js
// Desktop wrapper injection stub (wrapper.html)
window.saveDocument = function() {
state.pages[state.currentPageIndex] = serializeCurrentPage();
var docData = {
title: document.getElementById('doc-title').innerText,
pages: state.pages
};
console.log('OP_IPC:' + JSON.stringify({
type: 'OP_SAVE_DATA',
payload: JSON.stringify(docData)
}));
};
Why this broke password protection and document integrity:
- No Encryption Pass: The wrapper's stub extracted only
{ title, pages }and dispatched them as raw unencrypted JSON. It completely bypassedstate.documentPasswordand Web Crypto AES-GCM 256 encryption (window.encryptDocumentData). - Missing Document Metadata: The stub dropped all critical document metadata, including
dpi,format,unit,rulerUnit,margins, andisSpreadMode. - Non-Configurable Function Statement: In
io/file-io.js,saveDocumentwas originally declared as a top-level function declaration (function saveDocument()). In non-strict browser scripts, this created a non-configurable property (configurable: false) onwindow, preventing extensions from attaching getter/setter traps viaObject.defineProperty. - Silent Password Loss: Because the desktop wrapper's
atomicSavereceived unencrypted JSON from the injected stub, the resulting.opubfile on disk contained no encryption wrapper (encrypted: true,salt,iv,data). When reopened, the loader saw plain JSON and loaded it directly without requesting the password.
π οΈ Fix
The issue is resolved through a defensive desktop bridge in extensions/system-patches.js and an adjustment to function configurability in io/file-io.js:
1. Configurable Declaration (io/file-io.js)
Changed function saveDocument() to an explicit property assignment:
:::js
window.saveDocument = function() { ... };
This ensures window.saveDocument is configurable and can be intercepted by property descriptors. Also updated saveDocumentAs to invoke window.saveDocument().
2. Desktop Save Bridge & Interception (extensions/system-patches.js)
Implemented masterSaveDocument and masterExtractSnapshot and protected both properties using Object.defineProperty:
:::js
Object.defineProperty(window, 'saveDocument', {
get: function() {
return masterSaveDocument;
},
set: function(newFn) {
// Intercept desktop wrapper injection, flag desktop bridge as active,
// and retain our secure masterSaveDocument with AES-GCM encryption & full metadata.
_desktopBridgeActive = true;
console.log("OpenPublisher: Desktop save bridge connected securely with encryption support.");
},
configurable: true,
enumerable: true
});
3. Unified Encryption and Metadata Pipeline
When saving in desktop mode, masterSaveDocument:
- Serializes the active page and gathers full document metadata (
dpi,format,unit,rulerUnit,margins,isSpreadMode,documentProperties). - Checks
state.documentPassword. If present, encrypts the document payload using AES-GCM 256 (window.encryptDocumentData). - Dispatches the serialized payload to the desktop wrapper via
OP_IPC:{"type":"OP_SAVE_DATA","payload":...}. - Updates dirty state baselines and Recent Files thumbnails.
- Leaves standard browser workflows (
showSaveFilePickerand blob downloads) unaffected.
π§ͺ Verification / Test Coverage
Automated end-to-end tests were conducted in a headless Chromium environment verifying all 7 conditions:
- Configurable Property Verification:
window.saveDocumentexists as a callable function. - Hijack Interception: Wrapper script attempts to overwrite
window.saveDocumentwith an unencrypted stub are intercepted; the secure function is preserved and_desktopBridgeActiveis flagged. - Desktop IPC Dispatch: Calling
saveDocument()in desktop mode emitsOP_IPCmessages with typeOP_SAVE_DATA. - AES-GCM Encryption Integrity: Documents saved with a password produce a payload containing
encrypted: true,salt,iv, and ciphertextdata. - Decryption Round-Trip: The encrypted payload is successfully decrypted with
window.decryptDocumentDatausing the correct password, matching the original document structure and metadata. - Password Rejection: Decryption attempts with an incorrect password fail with an authentication error.
- Unencrypted Metadata Preservation: Documents saved without a password preserve all document metadata fields (
dpi,format,margins,isSpreadMode, etc.).
β Checklist Completed
- [x]
io/file-io.js: Changedfunction saveDocument()towindow.saveDocument = function() { ... }so the property is configurable. UpdatedsaveDocumentAsto route throughwindow.saveDocument(). - [x]
extensions/system-patches.js: ImplementedmasterSaveDocumentandmasterExtractSnapshotwith full AES-GCM 256 encryption and metadata preservation. Protectedwindow.saveDocumentandwindow.extractDocumentSnapshotwith getter/setter traps viaObject.defineProperty. - [x]
index.html: Bumped all script, stylesheet, and asset cachebusters from?v=5.1.9to?v=5.1.10. - [x]
ui/dashboard.js: Bumped template index fetch cachebuster from?v=5.1.9to?v=5.1.10. - [x]
README.md: Updated incremental version history table and summary to include version5.1.10.
π Version 5.1.10 - Open Publisher