Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

merge before rewrite #29

Merged
merged 33 commits into from
Jun 22, 2024
Merged

merge before rewrite #29

merged 33 commits into from
Jun 22, 2024

Conversation

dj1ch
Copy link
Owner

@dj1ch dj1ch commented Jun 22, 2024

No description provided.

minigotchi-ESP32/parasite.cpp Fixed Show fixed Hide fixed
minigotchi-ESP32/parasite.cpp Fixed Show fixed Hide fixed
minigotchi-ESP32/parasite.cpp Fixed Show fixed Hide fixed
serializeJson(doc, buf);
strncat(fullCmd, command, sizeof(fullCmd) - 1);
strncat(fullCmd, ":::", sizeof(fullCmd) - strlen(fullCmd) - 1);
strncat(fullCmd, buf, sizeof(fullCmd) - strlen(fullCmd) - 1);

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
minigotchi-ESP32/parasite.cpp Dismissed Show dismissed Hide dismissed
// target is an SSID, which should only be 32 characters at most
// Unlikely scenario but will truncate to 29 characters + "..." in case
// that gets disrespected by someone
if (strlen(target) > 32) {

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
if (Config::screen == "IDEASPARK_SSD1306") {
int numCharPerLine = ssd1306_ideaspark_display->getWidth() /
ssd1306_ideaspark_display->getMaxCharWidth();
if (strlen(data) <= numCharPerLine &&

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
Frame::essidLength = measureJson(doc);
Frame::headerLength = 2 + ((uint8_t)(essidLength / 255) * 2);
Frame::beaconFrame = new uint8_t[Frame::pwngridHeaderLength + Frame::essidLength + Frame::headerLength];
memcpy(Frame::beaconFrame, Frame::header, Frame::essidLength);

Check notice

Code scanning / devskim

There are a number of conditions in which memcpy can introduce a vulnerability (mismatched buffer sizes, null pointers, etc.). More secure alternitives perform additional validation of the source and destination buffer Note

Problematic C function detected (memcpy)
void Parasite::sendPwnagotchiStatus(parasite_pwnagotchi_scan_type_t status,
const char *frd) {
if (Config::parasite) {
if (frd != nullptr && strlen(frd) > 25) {

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
while (Serial.available() > 0) {
String line = Serial.readStringUntil('\n');
if (line.startsWith("chn:::")) {
int chn = atoi(line.substring(6).c_str());

Check warning

Code scanning / devskim

These functions are historically error-prone and have been associated with a significant number of vulnerabilities. Most of these functions have safer alternatives, such as replacing 'strcpy' with 'strlcpy' or 'strcpy_s'. Warning

Banned C function detected
void Parasite::formatData(char *buf, const char *data, size_t bufSize) {
buf[0] = '\0';
strncat(buf, data, bufSize - 4);
strncat(buf, "...", bufSize - strlen(buf) - 1);

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
minigotchi-ESP32/parasite.cpp Dismissed Show dismissed Hide dismissed
minigotchi-ESP32/parasite.cpp Dismissed Show dismissed Hide dismissed
@dj1ch dj1ch merged commit 61c9cf2 into main Jun 22, 2024
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants