code-review-cpp
Security review of C / C++ code — memory-safety and the classic unsafe-API sinks. Load when reviewing C/C++ source/PR, on .c/.cc/.cpp/.h in scope, or "review this C code". Signals: Makefile/CMakeLists, strcpy/sprintf/memcpy, malloc/free, raw pointers, format strings, parsers.
v2026.10.14-ee0e0c53 installazioni+3 in 7 giorni27 StelleMITsincronizzato 23 ore fa
Installa
Non hai ancora la CLI di NotHoly? Installala prima.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install noorqureshi/code-review-cppScrive in ~/.notholy/skills dopo aver controllato la firma e lo SHA-256.
FirmaFirmato, ed25519
Pacchetto0fe75f4c…55fb5ea5
0fe75f4cd96f…d74355fb5ea51 file · 1.7 KBScansioneBassonessuna segnalazione
Sorgentegithub.com/NoorQureshi/security-skills/tree/main/skills/code-review/code-review-cpp@ee0e0c5
Questa voce non è ancora scritta in italiano, quindi è mostrata in un'altra lingua: English.
In questa pagina
When it applies
Reviewing native C/C++ (a service, a parser, a library). The bugs are overwhelmingly memory safety — the highest-impact, most exploitable class — plus the handful of unsafe APIs that cause them.
Why it works
C/C++ has no bounds checking: a length mistake, a lifetime mistake, or attacker-controlled format string becomes a memory-corruption primitive. Most of these trace to a small, greppable set of APIs and patterns, and sanitizers/fuzzing confirm the ones static reading only suspects.
Sinks & patterns (grep, then reason about lengths and lifetimes)
- Buffer overflow:
strcpy,strcat,sprintf,gets,scanf("%s"),memcpy/memmovewith an unchecked or attacker-influenced length; fixed stack buffers filled from input. - Format string:
printf(user),fprintf(f, user),syslog(user)— user data as the format arg. - Integer issues: size/length arithmetic that can overflow or go negative and then feeds an
allocation or copy (
malloc(n*size),len-1); signed/unsigned confusion in bounds checks. - Use-after-free / double-free:
freethen use; ownership unclear across functions; dangling pointers after realloc; C++ iterator invalidation, dangling references,std::movemisuse. - Off-by-one / OOB:
<=in loop bounds, missing NUL terminator,strncpynot null-terminating. - Command/path:
system/popen/exec*with concatenated input; unchecked../in path handling. - C++ specifics: unchecked
.at()vs[], unsafereinterpret_cast, deserialization of untrusted data into objects,std::string↔C-string length mistakes.
Method
- Run
clang --analyze/cppcheckandsemgrep; treat as leads. rg 'strcpy|strcat|sprintf|gets|memcpy|system\(|printf\s*\([^"]'and, for each, trace the size and the source of the data.- For every allocation/copy, check the length's origin and arithmetic for overflow.
- Where reachable with input, confirm with a fuzzer + ASan (
libFuzzer/AFL++) — a crash under ASan is proof; escalate toexploit-memory-corruptionfor exploitability.
Gotchas
- A crash isn't automatically exploitable, but under ASan it's a real memory-safety bug worth reporting.
- Modern C++ (
std::span,std::string_view, smart pointers) reduces but doesn't remove these — raw buffers and FFI boundaries are where they persist. strncpy/snprintfare safer but have their own truncation/termination traps — read the lengths.
References
CERT C/C++ Coding Standard; OWASP C-Based Toolchain hardening; ASan/libFuzzer docs.
File di questa versione
- SKILL.md3.1 KB
Permessi
| Permesso | Dichiarato | Trovato dalla scansione |
|---|---|---|
| Legge file | No | No |
| Scrive file | No | No |
| Esegue comandi shell | No | No |
| Usa la rete | No | No |
| Usa i connettori | No | No |
| Controlla un browser | No | No |
Segnalazioni della scansione
Rivisto il 13 nov 2026
La scansione non ha trovato nulla da segnalare in questa versione.
Una scansione pulita abbassa il rischio, ma non prova che il pacchetto sia sicuro. Leggi quello che installi.
| Versione | Pubblicata | Commit | SHA-256 | Firma | Cambio di permessi |
|---|---|---|---|---|---|
| v2026.10.14-ee0e0c5 | 13 nov 2026 | ee0e0c5 | 0fe75f4c | Firmata | – |
Altro da NoorQureshi
Tutto da questo editoreAltro in Web e bug bounty
Vai alla categoria- src-hunterzhaoxuya520/src-hunter5
- owasp-top10-analysissecurityskills/owasp-top10-analysis5
- testing-for-xml-injection-vulnerabilitiesmukul975/testing-for-xml-injection-vulnerabilities5
- offensive-xsssnailsploit/offensive-xss5
- offensive-rcesnailsploit/offensive-rce5
- source-review-techniqueaeondave/source-review-technique5
Chiedi tutto quello che il tuo perimetro consente.
Crea un account, aggiungi crediti e fai la prima domanda in chat o nel terminale.
- 1/3
Crea l'account
Privato o azienda. Puoi passare ad azienda in seguito senza perdere saldo o chiavi.
PrivatoAzienda - 2/3
Aggiungi crediti
Con carta. Paghi a token, senza abbonamento.
$5.00ricarica minima - 3/3
Chiedi
In chat, oppure installa la CLI ed esegui notholy login nel terminale.
$ notholy login