News for hackers. Stuff that matters.
Re:CJSON – Ultralightweight JSON parser in ANSI C by waoush on Sunday February 13, 2022 @02:52AM (#30320062)
Coming in to give this a +1

I am developing an Apache module that does some authentication stuff, and I needed a way to parse and read JSON in C. I really did not want to deal with doing that myself, and I wanted to avoid any complicated library.

This is super easy to use, and is just one file.

Re:CJSON – Ultralightweight JSON parser in ANSI C by Mandatum on Sunday February 13, 2022 @03:41AM (#30320292)
This makes me nervous.

Are you parsing JWT objects?

A parser written in C shouldn’t be used on something like an authentication library for web services.

Re:CJSON – Ultralightweight JSON parser in ANSI C by freedomben on Sunday February 13, 2022 @06:08PM (#30326516)
I really don't understand the widespread fear of C/C++ that I see so often. The vast majority of security pitfalls are from using very old functions that don't check input. These are easily caught with linters and scanners. In many cases the compiler itself will warn you if you use them. Don't ignore warnings!
Re:CJSON – Ultralightweight JSON parser in ANSI C by waoush on Sunday February 13, 2022 @02:14PM (#30324609)
It is JWT introspection. Apache modules have to be written in C, and therefore so does my parser. It's another piece of infrastructure.

Whether or not it makes sense to do it like that is another story, but I don't have control over the design of enterprise architecture.

Re:CJSON – Ultralightweight JSON parser in ANSI C by Mandatum on Monday February 14, 2022 @12:49AM (#30328785)
Remember that Apache Remote Code Execution bug? No, not Struts, the other one. No, not mod_cgi, the other one. No, not auth_digest the other one.. ad inifinum. These were all caused by so-called "unsafe legacy functions". Just because YOU might not implement them, doesn't mean others won't.
Re:CJSON – Ultralightweight JSON parser in ANSI C by mburee on Sunday February 13, 2022 @09:31AM (#30321943)
Can you elaborate? I mean it's not like that a lot of authenticator or crypto is written in C
Re:CJSON – Ultralightweight JSON parser in ANSI C by Mandatum on Monday February 14, 2022 @09:23PM (#30341851)
The possibility for Remote Code Execution vulnerability from an unauthenticated user. This should be offloaded into a memory safe language, ideally by a parser that's been battle tested.