Skip to content

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

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

πŸš€ Release: beta β†’ master#88
rajashish147 merged 5 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(ci): infra guard regex + exclude verify-stabilization.sh
  • 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 15:34
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

To fix this, we should ensure that potentially user-influenced content in err cannot inject new log lines or otherwise confuse log consumers. The general approach is to sanitize any string representation of err before logging: strip \n and \r characters (and optionally other control characters) and ensure the log makes clear where user-controlled content starts.

The best minimal-change fix here is to change logErr so it does not pass the raw err object directly to console.error. Instead, we can derive a safe string representation (using String(err) or err.message and optionally err.stack), remove any newline and carriage-return characters from the message we log on a single line, and then log that single sanitized string. This keeps existing behavior (healthcheck still logs errors, still exits with the same codes) while preventing multi-line log spoofing. No external packages are needed; we can use built-in JS string methods.

Concretely, in healthcheck.js, we will replace the body of logErr (lines 20–22) with logic that:

  • Converts err into a descriptive string (e.g., including name and message, and maybe a truncated/sanitized stack on a separate pass).
  • Removes \r and \n from the parts that might contain attacker input.
  • Logs a single, clearly delimited string via console.error.

We will not touch the rest of the file; all existing calls to logErr remain unchanged.

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,10 @@
 }
 
 function logErr(prefix, err) {
-  console.error(`[healthcheck] ${prefix}`, err);
+  // Sanitize error output to avoid log injection via newlines in error messages
+  const errStr = String(err);
+  const sanitizedErrStr = errStr.replace(/[\r\n]+/g, ' ');
+  console.error(`[healthcheck] ${prefix}: ${sanitizedErrStr}`);
 }
 
 process.on('uncaughtException', (err) => {
EOF
@@ -18,7 +18,10 @@
}

function logErr(prefix, err) {
console.error(`[healthcheck] ${prefix}`, err);
// Sanitize error output to avoid log injection via newlines in error messages
const errStr = String(err);
const sanitizedErrStr = errStr.replace(/[\r\n]+/g, ' ');
console.error(`[healthcheck] ${prefix}: ${sanitizedErrStr}`);
}

process.on('uncaughtException', (err) => {
Copilot is powered by AI and may make mistakes. Always verify output.
@rajashish147 rajashish147 merged commit d2e56ee 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