Craig Francis's Avatar

Craig Francis

@craigfrancis.bsky.social

Security, Accessibility, Performance... trying to make the world better.

29 Followers  |  51 Following  |  12 Posts  |  Joined: 28.11.2023  |  1.6346

Latest posts by craigfrancis.bsky.social on Bluesky

What I was getting at - I hope for a future where the easy to do is the secure option, with programmers having to really go out of their way to do something dangerous.

09.08.2025 14:17 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Why is the last one the easiest to type, read, and dare I say it understand?

(not actually understand, if you did then you wouldn’t do this, but anyway).

08.08.2025 22:53 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Baby purple plant, it’s so cute.

Baby purple plant, it’s so cute.

It’s starting to grow, and is in a new pot.

It’s starting to grow, and is in a new pot.

It’s now a good size, providing a bit bit of colour while next to the window.

It’s now a good size, providing a bit bit of colour while next to the window.

Ahh, it’s taken over, what happened; it’s taking up all of the space, and some more.

Ahh, it’s taken over, what happened; it’s taking up all of the space, and some more.

This is one of my baby plants :-)

12.06.2025 11:23 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
php-is-literal-rfc/examples/sql-basic.php at 9e9223a4b98987166938f53b4c4bd37ed7cd50e9 Β· craigfrancis/php-is-literal-rfc Proposal for the `is_literal()` function. Contribute to craigfrancis/php-is-literal-rfc development by creating an account on GitHub.

With identifiers in SQL, this should either be a developer defined string in the SQL (e.g. have an allow-list array, where the key is an alias or numeric offset, the values are the SQL)… or, your database abstraction should have a way to parameterise, e.g. $aliases in:
github.com/craigfrancis...

08.02.2025 11:35 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Yep, I’ve got some examples in PHP:
github.com/craigfrancis...

If memory serves, you’re using Go atm; so this is how I would start, with a package that’s for the database abstraction (maybe taking an SQL string, or individual parameters for an ORM):
github.com/craigfrancis...

08.02.2025 10:53 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I would add that developers still make mistakes with prepared statements (especially when the SQL string is built via complex conditions/concatenation/etc, or junior developers make edits), so you must also validate the SQL strings are developer defined:
eiv.dev

07.02.2025 21:26 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

Are you safe from injection vulnerabilities?

Even using abstraction layers like Doctrine or parameterised queries mistakes can still happen.

@craigfrancis.bsky.social shows us how mistakes can be made and what can be done to mitigate them.

Buy your ticket here: https://buff.ly/40Ck2WR

#phpuk

22.01.2025 10:00 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

Agree completely, it’s why I see all automated pen test results as the first draft… they are just the start of an investigation, where results could be discounted immediately, or be part of a discussion with the developer. Also, no found β€œissues” does not mean the system is 100% secure.

20.01.2025 17:25 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I believe it’s to cover a user following a link to the API (maybe from an email, or malicious link), if the API can return HTML content, it would be like a normal web page for the browser; so pen test tools like to see a β€˜none’ CSP.

20.01.2025 01:43 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

It’s how they got it to work, while they take a HTML string, a different package could take a CLI string in the same way.

So the functions first argument can be β€œconvert ? -resize ? ?”, and because it’s unexported, that must be provided during compile time.

09.01.2025 12:39 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

And, to prevent completely, use Google Safe HTML package as an example, and use an β€œun-exported string type”.

e.g. define a package/function where the first argument is for the command string, the rest get escaped as arguments… partial example:
github.com/craigfrancis...

08.01.2025 08:45 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Ending Injection Vulnerabilities How programming languages and libraries can being an end to Injection Vulnerabilities.

I think a lot of people know about it, but mistakes still happen, and as an industry we haven’t implemented anything that actually stops it (e.g. ORMs often have a complicated interface).
eiv.dev

23.12.2024 11:54 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

XSS vulnerabilities keeping you up at night? 😱 Google's new "Commitment to Secure by Design" whitepaper has answers! Safe Coding and web platform improvements are key. Read more (page 7):
static.googleusercontent.com/media/public...

16.11.2024 21:31 β€” πŸ‘ 8    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0
Ending Injection Vulnerabilities How programming languages and libraries can being an end to Injection Vulnerabilities.

SQL Injection still exists despite abstractions like ORMs, QueryBuilders, & Parameterised Queries; simply because it’s easy to make mistakes (especially for new developers). Programming languages could find/stop these mistakes by identifying β€œtrusted developer defined strings”:
eiv.dev

29.11.2023 09:38 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@craigfrancis is following 20 prominent accounts