News for hackers. Stuff that matters.

ucarion

Six-digit verification codes for something like a "forgot password" flow are OTPs -- they're only good for one login -- but they are not HOTP/TOTPs. HOTP/TOTP has a registration step, where you copy a server-generated secret to your phone through a QR-code-encoded otpauth:// URI (https://github.com/google/google-authenticator/wiki/Key-Uri-...). That doesn't happen in a "forgot password" flow.

Incidentally, if you think of TOTP as being HMAC(unix mod 30, secret), one idea would be to do public key crypto instead of symmetric HMAC stuff. That's basically what a security key is.

If you additionally made it so that you couldn't phish the security key -- by having the OS + web browser know which apps can ask for which security keys -- you'd have reinvented WebAuthn.

P.S.: Make you sure you have stuffing protection in place against these kinds of six-digit-code auth schemes. A million possibilities is often acceptable for a secondary factor, but it's useless if attackers can just try all million codes.

Since they're in the thread, nice article 'dogacel! I've never seen an article on this that also took the time to dig into HMAC internals and that gnarly DT function.

Re:Declarative Schemas for simpler database management on Thursday April 03, 2025 @02:46PM (#43573739)
Sorry if asked and answered: can you hand-edit the generated migrations? Like, what if I want to do a create index concurrently or something?
Re:argp: GNU-style command line argument parser for Go on Sunday March 23, 2025 @01:07PM (#43454212)
I think short options taking a value in the same argv (i.e. `-o=1` stuff) isn't a GNUism mostly because it's backwards-incompatible with POSIX. `=` is a valid getopt option character, `chmod` uses it.

That said, I think? 'nloomans means for USER_CONTROLLED_DATA to be a set of short flags, not flag values, as in:

    root@08e9950d5bfd:/# export USER_CONTROLLED_DATA=lh 
    root@08e9950d5bfd:/# ls -a"$USER_CONTROLLED_DATA"
    total 56K
    drwxr-xr-x   1 root root 4.0K Mar 23 16:51 .
    drwxr-xr-x   1 root root 4.0K Mar 23 16:51 ..
    [...]
Not that I've seen this in the wild before. But everyone's use of bash is a unique personal hell anyway.
Re:IO Devices and Latency on Thursday March 13, 2025 @03:16PM (#43356391)
That makes sense. The weirdness of https://docs.aws.amazon.com/ebs/latest/userguide/ebs-io-char... makes more sense now. Reminds me of DynamoDB capacity units.
Re:IO Devices and Latency on Thursday March 13, 2025 @02:34PM (#43356054)
Really, really great article. The visualization of random writes is very nicely done.

On:

> Another issue with network-attached storage in the cloud comes in the form of limiting IOPS. Many cloud providers that use this model, including AWS and Google Cloud, limit the amount of IO operations you can send over the wire. [...]

> If instead you have your storage attached directly to your compute instance, there are no artificial limits placed on IO operations. You can read and write as fast as the hardware will allow for.

I feel like this might be a dumb series of questions, but:

1. The ratelimit on "IOPS" is precisely a ratelimit on a particular kind of network traffic, right? Namely traffic to/from an EBS volume? "IOPS" really means "EBS volume network traffic"?

2. Does this save me money? And if yes, is from some weird AWS arbitrage? Or is it more because of an efficiency win from doing less EBS networking?

I see pretty clearly putting storage and compute on the same machine strictly a latency win, because you structurally have one less hop every time. But is it also a throughput-per-dollar win too?

Re:Canon EF and RF Lenses – All Autofocus Motors on Monday March 10, 2025 @11:56AM (#43321926)
Such a cool website.

In case anyone else was looking for it, this article from the same author covers the more algorithm-y question of how a camera body decides to actually use these motors when you press the "focus" button: https://exclusivearchitecture.com/03-technical-articles-DSLR...

I can't find any articles on how a camera body decides what is and isn't a desired subject. I'm guessing there's some amount of machine learning-type stuff involved in that, seeing as how they can detect human (and bird?) faces?

Re:Building a Medieval Castle from Scratch on Thursday January 23, 2025 @05:23PM (#42808677)
You could rent a car out of Auxerre, but don't count on being able to get by in rural l'Yonne without one.
Re:"Rules" that terminal programs follow on Thursday December 12, 2024 @05:52PM (#42404247)
What does "cooked" mode mean in the context of this article?
Re:The "simple" 38 step journey to getting an RFC on Thursday December 05, 2024 @04:32PM (#42333004)
I didn't know RFCs are being written with xml2rfc directly anymore; I was under the impression most work was now happening through https://github.com/cabo/kramdown-rfc, which lets you hand-write markdown instead of hand-writing XML.

And then https://github.com/martinthomson/i-d-template, though a bit elaborate, does automate a lot of IETF stuff, including use of kramdown-rfc.

Re:Coinbase won Tornado Cash appeal on Wednesday November 27, 2024 @01:22PM (#42258333)
The ruling comes down to the definition of "property", and the court finds that Tornado Cash's immutable smart contracts aren't property. Treasury can only sanction property under the law. Tornado is a tool that nobody controls, and which OFAC cannot sanction.

> Indeed, when someone has a property interest, he or she typically has the “rights of possession and control.” And “one of the most essential sticks in the bundle of rights that are commonly characterized as property” is “the right to exclude others.”

> The immutable smart contracts at issue in this appeal are not property because they are not capable of being owned. More than one thousand volunteers participated in a “trusted setup ceremony” to “irrevocably remov[e] the option for anyone to update, remove, or otherwise control those lines of code.” And as a result, no one can “exclude” anyone from using the Tornado Cash pool smart contracts.

Immutability is what makes this whole thing work for Tornado. The ruling is basically a whole explanation of why an immutable smart contract isn't property, isn't a service, isn't a patent, it isn't anything Treasury can touch. In fact, it's not even a "contract" (no counterparty).

But the mutable aspect of Tornado -- the optional gas fee anonymization middlemen, who are registered via a mutable smart contract -- they're still in the rough. Which makes the rally in the TORN coin those middlemen get paid in all the weirder.

It seems pretty clear to me that Treasury can sanction all of those Tornado relayers, because relayers have control over their actions; their participation happens through a mutable smart contract, and they can stop at any time.

Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @03:07PM (#41998984)
Almost every calendar system has a similar trick: https://en.wikipedia.org/wiki/Intercalation_(timekeeping)

The west inherits from the Romans, and Julius Caesar standardized away the Roman intercalary month by glomming it into Feburary. Before that a "priest" (the pontifex maximus) (in scare-quotes because it was a political office) would add that month on an ad-hoc basis. Not so different!

Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @02:35PM (#41998650)
tzdb often has the answer, and it's almost always because everyone used to do local solar time (i.e. on average, the sun is at the top of the sky at noon) until convenience (i.e. train and plane schedules) required an offset friendlier to mental math.
Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @02:30PM (#41998605)
I mention Asia/Kathmandu instead of Pacific/Chatham or Australia/Eucla mostly because it's not one of those "exotic birds / kangaroos outnumber humans 5:1" kinds of places.
Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @02:21PM (#41998525)
If you go by the wtf-ness of the comments on a tz, Asia/Riyadh has gotta be up there. But contemporarily it behaves as `<+03>-3`, which is vanilla.
Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @02:18PM (#41998482)
You should read Matt Levine's Money Stuff! I think his is the tone I roughly was going for here.
Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @02:16PM (#41998461)
Thanks! The irony is not missed on me. I think I have the dates internally in the article metadata, just didn't set up my Hugo templates to display it. TODO!
Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @02:12PM (#41998423)
In theory, this can be expressed in tzdb. Obviously, it will cause problems.

The only really important assumption not obviously present in TZif's data format is that when you go from a local time to a UTC time, there can only be up to two possibilities. A lot of software works on that assumption, for instance java.time.LocalDateTime has a withLaterOffsetAtOverlap():

https://docs.oracle.com/javase/8/docs/api/?java/time/LocalDa...

That implicitly assumes that whenever it's ambiguous what 2:30AM means, you can only have two possible solutions (pre- and post-DST). If a timezone were ever to manipulate its offsets so that there were three or more solutions (such as if they did a "fall back" at 2:00AM and then 2:15AM or something), a lot of stuff would be unable to represent that.

Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @01:57PM (#41998220)
Japan does something similar in the context of things that close after midnight: https://en.wikipedia.org/wiki/Date_and_time_notation_in_Japa...

FWIW, the English-speaking world used to switch years on March 25: https://en.wikipedia.org/wiki/Calendar_(New_Style)_Act_1750#...

Neither of these are technically things that tzdb can even talk about. They're concerned with civil time, not calendars or other "reckoning" problems.

Re:Australia/Lord_Howe is the weirdest timezone on Wednesday October 30, 2024 @01:48PM (#41998120)
This is really neat!

Separately, I'm a little skeptical of the tzdb's endeavor of even thinking about pre-Unix-epoch stuff. The bug-to-utility ratio of that stuff doesn't seem to be there. `zic` is where most of the ugly gnarliness of tzdb lies, and I sometimes feel that it would have been better if `zic` weren't an artifact others could depend on.

Re:Un Ministral, Des Ministraux on Wednesday October 16, 2024 @01:09PM (#41861389)
I'm not sure if being from the north of France changes things, but I think the Renaud song is much more familiar to folks I know than the wind.
I think this is the website for the FBI's sting? https://nexfundai.com/

I find it interesting that they made up both "NexFundAI" and "NextFundAI" (with a t) with some sort of made-up relationship between the two.

For anyone curious about the real critique of utilitarianism behind the joke, it's called a utility monster:

https://en.wikipedia.org/wiki/Utility_monster

Re:SAML: A Technical Primer on Saturday September 28, 2024 @02:37PM (#41682124)
Oh don't get me wrong at all -- deprovisioning is huge indeed!

I'm not going to misleadingly edit my initial comment, and your comment is fair. I said "just" when I should have said "precisely". As in, I was already talking about how SAML interacts with "Bob from Sales got fired, probably should kick him out of the CRM". SAML gives you "Bob can't log into the CRM ever again", SCIM gives you "... and his CRM user and sessions are immediately revoked".

To be clear, SSOReady also has a "SCIM made easy" API, we definitely know about and care about helping people implement SCIM: https://ssoready.com/docs/scim/scim-quickstart

Re:SAML: A Technical Primer on Saturday September 28, 2024 @02:30PM (#41682080)
What I'm saying is you can implement the functionality of the parameter -- i.e., arbitrary data that survives a round-trip through a SAML login -- without literally using RelayState.

For example, the ID of a SAML `AuthnRequest` always gets echoed back to you in the SAML `Response`. So you can use that as an opaque identifier. You store ID/state pairs in the database when you start SAML logins, and look them back up when the assertion comes back to you. Basically, that's what we do on behalf of our customers.

It's a bit more work for us to implement, but it gives SSOReady customers the "deeplinking" functionality without the weird caveats that RelayState carries.

Re:SAML: A Technical Primer on Saturday September 28, 2024 @12:39PM (#41681325)
That's a very fair point! I'm going to add mention of SCIM / directory sync. I feel like it's easiest to stick that into the CISO section, since a big part of SCIM is just the deprovisioning aspect?

And yeah, you're right -- Okta, for example, doesn't let you add SCIM to an OIDC application. It's unfortunate -- there's no deep technical reason you can't mix OIDC and SCIM -- but it is the world we live in.

Re:SAML: A Technical Primer on Friday September 27, 2024 @11:50PM (#41677723)
Yeah, I didn't even mention the other bindings (HTTP-Redirect, Artifact, etc.) because they're not widely supported. Only SAML's HTTP-POST binding enjoys "every IDP supports this exact protocol" status.

FWIW, the for library I work on -- github.com/ssoready/ssoready -- we sidestepped this issue by simply not using SAML RelayState at all under the hood. Between the fact that it's vulnerable to attacker manipulation, and the size limits, it's not worth the pain. We just implement SAML RelayState / OAuth `state` via good old database persistence.

Re:SAML: A Technical Primer on Friday September 27, 2024 @05:03PM (#41675493)
FWIW back in the day, samltest.id was a dummy IDP, whereas sptest.iamshowcase.com is a dummy SP. You could hook these two up to each other and see the whole flow.
Re:SAML: A Technical Primer on Friday September 27, 2024 @05:01PM (#41675475)
I'm working on that at the instant (I wrote this article). Sadly the samltest.id squatter wants at least $15k, super lame. dummyidp.com it is!
Re:Ruby-SAML pwned by XML signature wrapping attacks on Wednesday September 18, 2024 @08:03PM (#41586981)
You'll be pleased to know that we're not making a ton of progress on the "split things over N docs" front.

In recent years IETF has given us SCIM (which is sort of like "offline SAML") which is 3 RFCs (goals, schemas, http stuff), and of course JWT is actually part of a series of like 9 RFCs (including JWT, of course, but also JWK, JWS, JWE, JWA, ...).

I think there's this phenomenon where people who are like "dude, nobody cares, just do the dumbest possible thing we can get away with" aren't the people who decide to get involved in writing security specs.

Older »