Skip to content

Commit bcebba2

Browse files
Potential fix for code scanning alert no. 28: Log injection
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6f345d9 commit bcebba2

File tree

1 file changed

+2
-1
lines changed
  • other/ton-telegram-example/server/api

1 file changed

+2
-1
lines changed

other/ton-telegram-example/server/api/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ app.post("/auth/telegram", async (req, res) => {
6969

7070
console.log("Received initDataRaw:", initDataRaw);
7171
console.log("isMocked:", isMocked);
72-
console.log("photoUrl:", photoUrl); // Log the photoUrl for debugging
72+
const sanitizedPhotoUrl = photoUrl ? photoUrl.replace(/\n|\r/g, "") : photoUrl;
73+
console.log("photoUrl (sanitized):", sanitizedPhotoUrl); // Log the sanitized photoUrl for debugging
7374

7475
if (!initDataRaw) {
7576
return res.status(400).json({ error: "initDataRaw is required" });

0 commit comments

Comments
 (0)