← back to 1940swallpaper
fix: delete leaked public/*.bak-* file and extend guard regex to block .bak-TIMESTAMP paths
f886ab143820576a9f1490cacb542dd6798792e8 · 2026-05-30 21:34:12 -0700 · SteveStudio2
- Removed public/index.html.bak-20260526152130 which was served as HTTP 200 via express.static
- Guard regex \.(bak|orig)(\.|$) only matched .bak at end or before a dot; .bak-TIMESTAMP slipped through
- Fixed to \.(bak|orig)([\.\-]|$) to also block the dash-terminated variant
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Files touched
M package-lock.jsonM server.js
Diff
commit f886ab143820576a9f1490cacb542dd6798792e8
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Sat May 30 21:34:12 2026 -0700
fix: delete leaked public/*.bak-* file and extend guard regex to block .bak-TIMESTAMP paths
- Removed public/index.html.bak-20260526152130 which was served as HTTP 200 via express.static
- Guard regex \.(bak|orig)(\.|$) only matched .bak at end or before a dot; .bak-TIMESTAMP slipped through
- Fixed to \.(bak|orig)([\.\-]|$) to also block the dash-terminated variant
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
package-lock.json | 13 +++++++++++++
server.js | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/package-lock.json b/package-lock.json
index c2d6599..324f02a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,6 +8,7 @@
"name": "1940swallpaper",
"version": "0.1.0",
"dependencies": {
+ "dotenv": "^17.4.2",
"express": "^4.21.0",
"helmet": "^8.1.0"
}
@@ -172,6 +173,18 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
+ "node_modules/dotenv": {
+ "version": "17.4.2",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
+ "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
diff --git a/server.js b/server.js
index 2455825..db449e8 100644
--- a/server.js
+++ b/server.js
@@ -150,7 +150,7 @@ require('./_universal-auth')(app, { siteName: "1940swallpaper" });
// Guard: never serve editor/snapshot artifacts from the static root.
app.use((req, res, next) => {
- if (/\.(bak|orig)(\.|$)|\.pre-|~$/i.test(req.path)) return res.status(404).send('Not found');
+ if (/\.(bak|orig)([\.\-]|$)|\.pre-|~$/i.test(req.path)) return res.status(404).send('Not found');
next();
});
← 3cae8fe feat(fleet): theme1/theme2 query-param-gated toggle on catal
·
back to 1940swallpaper
·
noopener,noreferrer on sister-site window.open popup 61f2bbd →