Skip to content

πŸš€ Release: beta β†’ master#87

Merged
rajashish147 merged 4 commits into
masterfrom
beta
Apr 4, 2026
Merged

πŸš€ Release: beta β†’ master#87
rajashish147 merged 4 commits into
masterfrom
beta

Conversation

@rajashish147
Copy link
Copy Markdown
Collaborator

πŸš€ Automated Release PR

This PR contains all changes from beta to master.


πŸ“¦ Latest Changes

  • fix(deploy): guard GITHUB_STEP_SUMMARY for set -u on VPS
  • fix: ESM healthcheck + CI exec validation
  • fix(docker): align HEALTHCHECK timing with liveness; robust healthcheck.js; deploy health debug

🧠 Notes

  • Auto-managed PR
  • Do not edit manually

@rajashish147 rajashish147 enabled auto-merge (squash) April 4, 2026 14:26
Comment thread healthcheck.js
},
);
function logErr(prefix, err) {
console.error(`[healthcheck] ${prefix}`, err);

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.

Copilot Autofix

AI about 2 months ago

In general, the fix is to avoid writing raw, potentially user-controlled strings (including error messages) directly to logs. Instead, sanitize them to remove or neutralize control characters (especially \n and \r) or clearly delimit them so they cannot forge additional log entries.

For this specific code, the cleanest low-impact change is to modify logErr so it never passes potentially untrusted values directly to console.error. Instead, build a safe, single-line string representation of the error or reason by:

  • Extracting a meaningful message (from err.message, err.toString(), or String(err)).
  • Stripping newline and carriage-return characters.
  • Including a minimal type indicator if useful (e.g., ErrorName: message).

We then log just that sanitized string along with the prefix, keeping semantics the same (we still report the error) while preventing multi-line injection. Only the logErr helper and its immediate logging call need to change, within healthcheck.js, and no new imports or dependencies are required.

Suggested changeset 1
healthcheck.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/healthcheck.js b/healthcheck.js
--- a/healthcheck.js
+++ b/healthcheck.js
@@ -18,7 +18,11 @@
 }
 
 function logErr(prefix, err) {
-  console.error(`[healthcheck] ${prefix}`, err);
+  const raw = (err && typeof err === 'object' && 'message' in err)
+    ? String(err.message)
+    : String(err);
+  const safe = raw.replace(/[\r\n]+/g, ' ');
+  console.error(`[healthcheck] ${prefix}: ${safe}`);
 }
 
 process.on('uncaughtException', (err) => {
EOF
@@ -18,7 +18,11 @@
}

function logErr(prefix, err) {
console.error(`[healthcheck] ${prefix}`, err);
const raw = (err && typeof err === 'object' && 'message' in err)
? String(err.message)
: String(err);
const safe = raw.replace(/[\r\n]+/g, ' ');
console.error(`[healthcheck] ${prefix}: ${safe}`);
}

process.on('uncaughtException', (err) => {
Copilot is powered by AI and may make mistakes. Always verify output.
@rajashish147 rajashish147 merged commit 2d69e8f into master Apr 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants