Earlier quoted context omitted.
I met regexes when I was 13, I think. I spent a little time reading the Java API docs on the language's regex implementation and played with a couple of regex testing websites during an introductory programming class at that age. I've used them for the rest of my life without any difficulty. Strict (formal) regexes are extremely simple, and even when using crazy implementations that allow all kinds of backreferences…
[flagged]
Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
21–30 of 40 posts
Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#22Earlier quoted context omitted.
[flagged]
This is too hot a take. Regular expressions are used in some cases where they shouldn’t be, yes, but there’s also been a ton of code which used other string operations but had bugs due to the complexity or edge-cases which would have been easier to avoid with a regex. You should know both tools and when they’re appropriate.
What is the claim? That it is compact for simple cases. Well Brainfuck is a compact programming language but I don't see it in production. Why?
Because the whole point of programming is that multiple eyeballs of different competence are looking at the same code. It has to be as legible as possible.
Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#23Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#24> To escalate privileges, we abused the token’s repo scope, which can manage repository collaborators, and invited our own GitHub user to be a repository administrator. From everything I know about pentesting, they should have stopped before doing this, right? From https://hackerone.com/aws_vdp?type=team : > You may only interact with accounts you own or with explicit written permission from AWS or the account owner
Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#25Breaking this down, several of AWS's core repos like the JS SDK use an allowlist of which contributor ids can run workflow actions in their PRs. The list was a regex, contained several short ids, and wasn't anchored with ^$, so if it allowed user 12345, then any userid containing 12345 could run their own actions on the PR, including one that exfiltrated access tokens. So they spammed GH with user creation requests,…
As a security dude I spend way too much of my time fixing missing anchors or unescaped wildcards in regex. The good news is that it's trivial to detect with static analysis tooling. The bad news is that broken regex is often used for security checks.
Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#26Earlier quoted context omitted.
At least the vuln was old enough so that they couldn't blame AI for it, otherwise the article would read different ;)
Ironically (?) an AI code review would very likely have noticed the overly-permissive regex.
Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#27Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#28How did they create so many GitHub accounts? I used login with GitHub in the past to prevent spam but I feel like, after hearing this, I need to check for something like account age to prevent spam.
Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#29Earlier quoted context omitted.
As a security dude I spend way too much of my time fixing missing anchors or unescaped wildcards in regex. The good news is that it's trivial to detect with static analysis tooling. The bad news is that broken regex is often used for security checks.
Sometimes I wish regexes were full matches by default and required prefixing and postfixing with `.*` to get the current behaviour
Re: Supply Chain Vuln Compromised Core AWS GitHub Repos & Threatened the AWS Console
#30> To escalate privileges, we abused the token’s repo scope, which can manage repository collaborators, and invited our own GitHub user to be a repository administrator. From everything I know about pentesting, they should have stopped before doing this, right? From https://hackerone.com/aws_vdp?type=team : > You may only interact with accounts you own or with explicit written permission from AWS or the account owner
It’s possible that AWS is a Wiz customer, which would allow them to do more stuff.