Skip to content

Dev - #16

Merged
WouterKoch merged 4 commits into
masterfrom
dev
Dec 12, 2025
Merged

Dev#16
WouterKoch merged 4 commits into
masterfrom
dev

Conversation

@WouterKoch

Copy link
Copy Markdown
Member

No description provided.

Comment thread server.js Outdated
}
}
} catch (error) {
console.log(`Error fetching Swedish name for ${nameResult.scientificName}:`, error.message);

Check failure

Code scanning / CodeQL

Use of externally-controlled format string High

Format string depends on a user-provided value.

Copilot Autofix

AI 8 months ago

The best fix is to ensure that untrusted data from users is never directly placed in the format string of logging functions such as console.log. Instead, use a constant format string with placeholders (such as %s), and pass the potentially untrusted data as an argument. For the affected code at line 926, this means modifying the call console.log(Error fetching Swedish name for ${nameResult.scientificName}:, error.message); to instead use console.log("Error fetching Swedish name for %s:", nameResult.scientificName, error.message);.

No new imports or significant functional changes are required, as this is only an adjustment to the way logging arguments are constructed.


Suggested changeset 1
server.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/server.js b/server.js
--- a/server.js
+++ b/server.js
@@ -923,7 +923,7 @@
           }
         }
       } catch (error) {
-        console.log(`Error fetching Swedish name for ${nameResult.scientificName}:`, error.message);
+        console.log("Error fetching Swedish name for %s:", nameResult.scientificName, error.message);
       }
     }
 
EOF
@@ -923,7 +923,7 @@
}
}
} catch (error) {
console.log(`Error fetching Swedish name for ${nameResult.scientificName}:`, error.message);
console.log("Error fetching Swedish name for %s:", nameResult.scientificName, error.message);
}
}

Copilot is powered by AI and may make mistakes. Always verify output.
@WouterKoch WouterKoch committed this autofix suggestion 8 months ago.
WouterKoch and others added 2 commits December 12, 2025 17:02
…olled format string

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@WouterKoch
WouterKoch merged commit f90fc20 into master Dec 12, 2025
4 of 6 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