Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Secure coding in C and C++

    Secure coding in C and C++

    Robert C. Seacord · 2005

    "Commonly exploited software vulnerabilities are usually caused by avoidable software defects. Having analyzed nearly 18,000 vulnerability reports over the past ten years, the CERT/Coordination Center (CERT/CC) has determined that a relatively small number of root causes account for most of them. This book identifies and explains these causes and shows the steps that can be taken to prevent exploitation. Moreover, this book encourages programmers to adopt security best practices and develop a security mindset that can help protect software from tomorrow's attacks, not just today's."--BOOK JACKET.

    ProgrammingSecurity & Privacy
    Open LibraryAmazon
    Stats for nerds
    7recommend
    11mentions
    9people
    2015–2023years
    82% recommend18% neutral

    Mentions per year

    201520162017201820192020202120222023

    What Hacker News says

    1. nobodyandproudOct 2023
      Read over "Secure Coding in C and C++".
      thread
    2. pjmlpDec 2022
      Learn C using the classical books, but also care about how to mitigate security issues while coding in C.

      "Secure Coding in C and C++"

      https://www.oreilly.com/library/view/secure-coding-in/978013...

      "The CERT C Secure Coding Standard"

      https://www.oreilly.com/library/view/the-cert-c/978032160319...

      MISRA-C

      https://www.misra.org.uk/

      Frama-C

      https://frama-c.com/

      Also have a look at the static analysis and warnings available across all major C compilers.

      thread
    3. blubDec 2021
      I personally like the nostarch security books. They published a book recently called "Designing secure software" which is still on my todo list, but based on the TOC it has really good breadth. Includes threat modelling, low-level issues, but also how to think about designing secure software or web security. It might make sense for you to read that, before moving to the specialised books below.

      The classic for C++ is Seacord's "Secure coding in C and C++". As for techniques, you'll want a mix of:

      * design (using smart pointers, taking advantage of array, vector and string, using optionals, atomics, etc)

      * compiler flags (gcc can for example make integer overflows which are normally undefined behaviour defined by wrapping)

      * static analysis (e.g. clang static analyser, clang-tidy, many commercial products)

      * dynamic analysis (e.g. the clang/gcc sanitizers or whatever VC++ is offering nowadays). They work well together with automated tests.

      * code review. It's extremely helpful to have an experienced engineer review your code.

      * fuzzing combined with sanitizers

      You'll probably want to read about threat modelling (e.g. Adam Shostack's book), to understand common attacks and how to think about them in relation to your projects.

      thread
    4. pjmlpApr 2021
      Start with the 2nd edition of "Tour of C++" from Bjarne Stroustrup, then "Programming: Principles and Practice Using C++" and finally 4th edition of "The C++ Programming Language".

      There are others for C++, but this would be a good start.

      As for C, "Extreme C" has nice up to day content.

      And in both cases, "Secure Coding in C and C++",

      https://www.amazon.com/Secure-Coding-2nd-Software-Engineerin...

      thread
    5. pjmlpSep 2020
      I would add to that list,

      "Secure Coding in C and C++, Second Edition"

      https://www.oreilly.com/library/view/secure-coding-in/978013...

      "Extreme C"

      https://www.packtpub.com/product/extreme-c/9781789343625

      thread
    6. peteeJun 2018
      C's biggest issue is well-warned (lazy?) programmers repeating the same mistakes that have been documented ages ago. In the analogy of shooting yourself in the foot, why is anyone using a gun without the safety training first??

      If you're serious about writing safer C code, certainly check up the following two resources from Robert Seacord:

      - SEI CERT C Coding Standard: https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Cod...

      - Secure Coding in C and C++: https://resources.sei.cmu.edu/library/asset-view.cfm?assetid...

      thread

    Related

    The CERT C secure coding standardRobert C. Seacord
    2017–2022

    The CERT C secure coding standard

    Robert C. Seacord
    3 recommend · 3
    Writing secure codeMichael Howard
    2015–2023

    Writing secure code

    Michael Howard
    2 recommend · 3
    Large-Scale C++ Volume IIJohn Lakos
    2020–2026

    Large-Scale C++ Volume II

    John Lakos
    1 recommend · 2
    Cover of The annotated C++ reference manual
    2013–2026

    The annotated C++ reference manual

    Margaret A. Ellis
    2 recommend · 13
    Cover of Embracing Modern C++ Safely
    2022–2025

    Embracing Modern C++ Safely

    John Lakos
    2 recommend · 5
    Cover of Designing object-oriented C++ applications using the Booch method
    2013–2026

    Designing object-oriented C++ applications using the Booch method

    Robert C. Martin
    3 recommend · 7
    Cover of Functional Programming in C++
    2019–2026

    Functional Programming in C++

    Ivan Cukic
    3 recommend · 6
    Cover of Effective Modern C++
    2014–2026

    Effective Modern C++

    Scott Meyers
    63 recommend · 127