HNHacker News
TopNewBestAskShowJobs

diafygi

6,537 karma · joined May 16, 2011

Website: https://daylightpirates.org/

Email: hn at my handle dot com

submissionscomments
diafygi··on Privacy analysis of Tiktok’s app and website
Hmmmm, I think it's a bit of an unreasonable expectation to think technology should prevent companies from breaking the law.

Most meatspace laws are expected to be followed despite there being little to no physical barrier to breaking them (e.g. there's no physical barrier preventing me from throwing a brick through a window, but it would still be vandalism).

Why should we expect laws in software to be different? Why should the burden of compliance be shifted from the individual/company to the infrastructure?

diafygi··on Make your website a black hole to big tech
GoAccess doesn't seem to have conversion funnel tracking. Or is available in some sub-feature or plugin?
diafygi··on Bose headphones are basically a spyware on your head
*if you use their app.

You don't have to use their app for day-to-day usage via Bluetooth, however, they make it impossible to initially setup noise canceling functionality without the app.

I'm extremely grateful that the Bluetooth protocol is broken up into specific functions, so I know that if I connect my headphones/car/etc. via bt audio it can't also send data to the cloud through my phone.

diafygi··on Using Firefox for a faster, calmer and distraction-free internet
I love containers as well. Does anyone know when/if they'll be coming to Firefox for Android and iOS?

Also, I really wish you would be able to specify which container you want in the Home button when using multiple urls for your default tabs.

So this:

    https://gmail.com/|https://gmail.com/
Would become something like this:

    {container:personal}https://gmail.com/|{container:work}https://gmail.com/
diafygi··on Bypassing GitHub's OAuth Flow with a Head Request
Ah, yes, that's correct. I guess I was assuming that once you issue a new authorization code, the authorization server should invalidate any previously issued access_tokens/refresh_tokens because the new authorization code represents a new grant. Or are you supposed to wait until the code is sent to the token endpoint (to get the access_token/refresh_token) before invalidating old access_tokens?
diafygi··on Bypassing GitHub's OAuth Flow with a Head Request
Hmmm, is there guidance saying that you should auto-redirect?

The spec says, "If the authorization server observes multiple attempts to exchange an authorization code for an access token, the authorization server SHOULD attempt to revoke all access tokens already granted based on the compromised authorization code."[1]

If an authorization server implements the recommended behavior and an auto-redirect, doesn't that mean that GET requests will no longer be safely considered immutable since they may cause revocation of previous access_tokens?

[1]: https://tools.ietf.org/html/rfc6749#section-10.5

diafygi··on Bypassing GitHub's OAuth Flow with a Head Request
Hmmm, as a user, I guess I would expect the opposite behavior, and I'd think the question should be why wouldn't you want to ask the user to authorize and app they already authorized?

A client should usually only redirect the user to the OAuth authorization endpoint when:

(a) they don't have an access_token (e.g. they haven't asked for authorization yet)

(b) their current access_token or refresh_token got rejected (e.g. the resource owner revoked access, so they need to reauthorize)

(c) they want to change scope of access

So the situation where you redirect the user to the OAuth authorization endpoint when they've already granted access and with the same scope is usually when something strange is going on (like when the client loses your access_token or this exploit happens).

So why would you have different behavior (not asking to click Authorize) just to streamline the atypical scenario? Especially when it leaves open the possibility to be exploited[1], create confusing situations[2], or be mis-categorized as an opt-in event when it isn't[3]. As a user, I'd like to think that I'd always get the same behavior every time I'm redirected to an OAuth authorization endpoint, because the OAuth provider doesn't have any idea what the situation is on the client side and assuming it's okay to auto-redirect without asking for my consent again is dangerous.

[1]: This HEAD bug would have not been able to be exploited in the wild if the auto-redirect wasn't in place.

[2]: In clients that allow users to have multiple accounts (where each can hook-up a github connection), auto-redirects creates confusing revocations across the multiple client accounts. For example, Bob authorizes a github connection to account A, then when he switches to account B wants to authorize github again. If auto-redirect is in place, then Bob wouldn't see anything (since it is a transparent redirect), but account B's connection would start working and account A's connection would silently stop working. If there were an authorize click, Bob would see the same behavior for account A and account B, and probably be able to put together that if he clicks authorize on one account, the other stops working. Auto-redirects makes Bob figuring out what's going on really hard.

[3]: Privacy regulations are requiring opt-in more and more, and OAuth is seen as a fairly good mechanism for proving someone "opt'd in". If a regulation requires a "consent" to have an expiration (e.g. an accounting app must require the user to re-authorize bank access on a yearly basis), then when the users is asked to "consent" again, if they get auto-redirected, they can later claim they were never asked to consent because they never clicked authorize again after a year.

diafygi··on Bypassing GitHub's OAuth Flow with a Head Request
In the proof of concept[1]:

1. Send an ajax HEAD request, which grants the permissions.

2. However, since the HEAD response doesn't have valid CORS headers, you can't read the 'code' parameter from the HEAD response.

3. To get around CORS, the proof-of-concept redirects the user to the same OAuth url again.

4. Since the user has already authorized the scope (from the previous HEAD request), Github automatically redirects back to the redirect_uri (the proof-of-concept page) with a new 'code' that the author can then use.

So I have two questions:

a) If I have 3rd party cookies disabled, will the "credentials: 'include'," part of the ajax HEAD request still work?

b) Why does Github automatically redirect back the 2nd time without asking the user to authorize again? I thought it was best practice to ask the user to click authorize every time even if they're authorizing the same scope they previously authorized?

[1]: https://not-an-aardvark.github.io/oauth-bypass-poc-fbdf56605...

diafygi··on I Got Access to My Secret Consumer Score
So I originally studied chemical engineering, and one of the common catchphrases is, "regulations are written in blood." The reason there's a requirement to put a pressure relief valve on that tank is because at some point a tank like it didn't have one and it blew up and killed people. However, safety in chemical engineering has been evolving over centuries as we have understood more about the dangers and consequences of dealing with chemical manufacturing.

For software, it feels like we're only at the beginning of understanding the dangers and consequences of the software, business models, and technology our industry has created. Unfortunately, if it follows the same path as other engineering disciplines, we likely will experience decades or centuries of bloodshed before it is regulated appropriately.

diafygi··on Ask HN: How do you roll back production?
We do something similar, where we just have a branch that is "prod", and the deploy script just checks out that branch, packages up all the things, and deploys them to the servers. If you want to roll back, just force-push the "prod" branch to whatever commit and run deploy again.

For database migrations, we (1) design them so they can be applied without breaking the existing app and (2) make a "pre-launch" commit that adds those migrations to the codebase but doesn't have any code that uses them yet.

To deploy, we merge the "pre-launch" into "prod" and deploy, and since the app doesn't use the new db changes yet, it will happily continue working fine. Then, at our leisure we can manually run the migration (either through the framework built-in migration tools or manually through the db shell). Then, we can merge the full "launch" branch into "prod" and deploy again, which will push the code that starts using the db changes.

To roll back, we move "prod" back to "pre-launch" and deploy, which moves the app back to the state where the code isn't using the db changes, but the changes are still expected to be in place. Then, we manually roll back the migrations using the reverse of whatever migration method you used originally, which is fine since nothing in the codebase in the "pre-launch" commit is using the db changes. Then, we move "prod" back to whatever commit we need to roll back to and deploy again.

It takes a bit of planning and forethought, but it means no downtime and you have all the time you need to manually apply and roll-back db changes that can take a while (adding indexes to huge tables, etc.).

diafygi··on The FBI Is Tracking Our Faces in Secret, and We’re Suing
> Not really sure how to fight that.

Rather than trying to challenge them on whether they really do have anything to hide, I usually try to challenge their assumption that privacy is an individual right. Privacy isn't an individual right. It's a societal right. It's there to ensure those who want to make change can effectively organize, which is necessary in a democratic society. So you have the right to privacy whether you like it to or not, because society needs it. Keeping your individual porn habits secret is a side effect.

People who tend to argue, "I have nothing to hide," usually think well of themselves. So if you can get them thinking of privacy as a social good, more "we" than "me", then you can show them that supporting privacy protections is more of an altruistic gesture than a vice.

If they want a specific example, the I usually talk about women's suffrage. It's only been 100 years since women didn't have the right to vote in the U.S., and suffragettes were extremely effective in 1919 by organizing privately then showing up in mass to overwhelm legislatures and mount demonstrations that couldn't be silenced or hidden. If lawmakers knew about all those damn women organizing such big events, women likely would not have been successful at getting the right to vote.

Privacy is the lubricant that lets society move, whether it's pro-life movements, pro-pot movements, or any other political movement. They all need privacy to actually be successful.

diafygi··on Duck Curve
Hmmm, so I work in the distributed energy resources sector, and I disagree that people in this space aren't recognizing how hard it will be to deeply decarbonize using intermittent generation. You're completely correct that as we add more and more intermittent generation to the grid, keeping the grid always online becomes crazy difficult.

However, everyone I know in the space looks at that challenge as opportunity rather than discouragement. It's not like we're going to hit high penetrations of intermittent renewables overnight. It's going to be a gradual ramp over years that allows us to also deploy complimentary systems to deal with the ever increasing intermittency. Piece-by-piece we will deploy flexibility technologies (DR, DERMS, storage, etc.) and move to new regulatory incentives and utility business models (performance-based ratemaking, etc.) that allow us to reach our 100% goals.

There's a ton of super smart people already working on the intermittency problem, and entire businesses are being built to solve it (disclosure: many of them use our platform). So I guess while I agree with your assessment of the level of difficulty, I don't agree with your level of despair. There's way too many smart engineers working in the space now for intermittency to be in impossible problem to solve.

diafygi··on Duck Curve
The saying that's now prevalent at utility conferences is, "In the past, we'd forecast load and deploy generation. In the future, we'll forecast generation and deploy load."
diafygi··on Duck Curve
Hmmmm, I think the difference is that the dip will be ever-increasing to the point where it completely eliminates the need for fossil-based generation. California (and many other places) have 100% carbon-free energy mandates over the next few decades, so this isn't a once-in-a-while situation where you can just ramp up a bit more at other facilities to get by for the maintenance window.
diafygi··on Duck Curve
Hmmmm, yes, probably. However the reasons for deploying millions of lithium batteries instead of a few dozen pumped hydro stations are likely more political and business reasons than technical reasons.

First, it's way easier and faster to just park containers full of batteries wherever you need to shift the energy than to find and build new pumped hydro location then build/upgrade the transmission to the locations where the load shifting is needed. And when you need the load shifting ASAP, you're probably going to opt for the solution that can deployed now, especially when the regulatory reaction to this problem is to adjust prices ("time of use" rates) to discourage people from using power during the slope.

Second, battery installers are able to sell directly to consumers, which means they can bypass utility bureaucracy. Many utilities are very slow to adopt "non-wires alternatives" because their business model doesn't incentivize them to building out a distributed, flexible grid, and they are increasingly becoming worried about their generation assets being financially stranded. This means that it's often easier to sell thousands of energy storage units to thousands of homes and businesses, than it is to sell that same thousand units directly to the utility. With pumped hydro, there's no distributed option, so you end up being at the mercy of the utility wanting your product.

So yes, you're probably right that pumped hydro is on paper cheaper for addressing the Duck Curve "neck" problem, but this is a case where the difference between theory and reality is substantial for non-technical reasons.

diafygi··on Duck Curve
Replying to my own comment with a more meta comment:

I'd also like to point out that the Duck Curve is a good example of the class of problem in the energy transition that seem like a major blocker at first and is often pointed to by detractors to using solar energy, but isn't really.

Since these types of problems take years to manifest, it can be being broken down into smaller prioritized problems (such as addressing the slope problem of the "neck") that we, the cleantech sector, can individually figure out and deploy solutions to without stopping progress decarboninzing the grid. If you just keep solving thousands of these smaller problems over time, eventually you'll end up solving the overall problem.

In a time where it's politically infeasible to do big things (e.g. building hundreds of nuclear generators), the cleantech sector has for the most part been making progress through incremental solutions that over time will get us where we need to go. I have no doubt that we'll solve the Duck Curve problem, but it will likely be one step at a time, not large strategic changes, which to outsiders make it seems like the problem is still a "blocker".

Anyway, this is what fighting climate change looks like, and as an engineer, it's tons of fun to know that if you just keep solving problems, you'll wake up one day in a 100% clean energy world that you helped create.

diafygi··on Duck Curve
CAISO has a great live dashboard that you can play around with on the actual real time demand and supply curves. If you switch to previous days, you'll see the "duck curve" is already here and not just speculation anymore.

https://www.caiso.com/TodaysOutlook/Pages/default.aspx

The issue nowadays isn't so much the depth of the dip in dispatchable (e.g. traditional) generation, but the slope of the ramp back up after the sun goes down (e.g. the "neck" of the duck). Base load natural gas an other fossil generation have a very difficult time spinning up that quickly (CAISO said it was ~11GW over 3 hours yesterday).

That's why batteries are such a hot topic in renewables right now. Not so much for storing power for "a rainy day", but for helping load shift during the day to prevent such a steep slope in the evenings. Lithium is pretty good at doing that kind of short, daily-burst storage job.

diafygi··on Congressman's phone password is 111111
I wonder what AI tech is being developed around detecting pin code entry on phones using passive CCTV networks.

If you process the feeds for public transit security cameras, I wouldn't be surprised if you can read the pin codes for a huge swath of the population. It would also reduce the need for law enforcement to try to get a suspect to tell them their passcode. Just look up that time they rode the subway 3 weeks ago and watch them enter it.

diafygi··on Latest Firefox Brings Privacy Protections Front and Center
Does anyone have a list of self-hosted server-side analytics tools with conversion funnel tracking?

The only self-hosted one I can find that has a funnel feature is Matomo.

diafygi··on Docker Hub Two-Factor Authentication
I really like the mockups in this post. It's so rare that you see discussion of authentication UI/UX.

Speaking of, are there any UI/UX design resources (books, tutorials, blog posts, etc.) on for modern authentication flows (2FA, OAuth, etc.)?

I've been searching for a while and can't seem to find anything substantial. All the design discussion I can find is around protocols/handshakes/security, but nothing about UI/UX best practices and possibilities.

diafygi··on YC Interview Tips from a Former YC Partner [video]
Hmmm, isn't that the parent's point, though? Being super successful as a VC or VC-funded startup is touted as the ultimate success by YC. However, there are many on this forum who don't agree that VC success is better than other types of success (bootstrapping, politics, charity, family, etc.), and some who even view VC culture as a net negative to society.

My point was that how you receive someone saying YC changed their life is highly dependent on whether you think that the result should be celebrated or emulated. Everyone has experienced things that changed their lives and the lives of those around them, so to someone who doesn't see VC success as very desirable, it comes across as a fairly weak argument.

diafygi··on YC Interview Tips from a Former YC Partner [video]
Isn't that kind of a shallow argument, though? Scouting changed my life, and changed the lives of hundreds of scouts I know personally. What matters is how it changed it.
diafygi··on BrachioGraph – a cheap, simple pen plotter
I see. I wonder if my hypothesis is still valid, even given lower quality rigidity. Human arms aren't made of big heavy metal rods, yet we can still draw beautifully. Couldn't cameras and software compensate for cheap unstable draw arms?
diafygi··on BrachioGraph – a cheap, simple pen plotter
It's my understanding that higher quality plotters/3d printers/mills' accuracy and precision come from higher quality motors (e.g. stepper motors instead of servos). Will it be possible to someday just put cameras on the plotter which watch the current print and self-correct as needed? That's basically what our eyes do when we write/sculpt/carve.

Will cheap motors + cameras + software eventually meet or exceed the quality of expensive high precision motors/controllers?

diafygi··on PG&E to cut power to 800k customers across California early Wednesday morning
Forest fires don't have much of a carbon footprint because all the carbon (e.g. vegetation) is already part of the carbon cycle.

Your carbon footprint is determined by how much carbon you're adding (e.g. burning gas that was previously sequestered deep underground) to the carbon cycle.

I suppose if a bunch of plastic got burned in the forest fire, that would technically be adding a carbon footprint, but it's likely negligible.

diafygi··on Show HN: 123Metrics – Privacy centered website metrics
From the EU Information Provider's Guide[1]:

"Examples of cookies that generally do NOT require consent: ... Authentication cookies ..."

Also, even if you're correct in needing to have a cookie consent, you're still missing the decline option.

Finally, and I say this with all possible respect as a fellow entrepreneur who completely understands that you are pouring huge amounts of time and effort into this, your response was pretty inappropriate by being so emotionally charged. You sounded personally offended and reacted by lashing out and attacking the criticizer. As a startup, you're going to encounter that kind of criticism very often, so I'd suggest you find a different way of responding to it.

[1]: https://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm#s...

diafygi··on Show HN: 123Metrics – Privacy centered website metrics
"We only use cookies that are necessary for the website functionality. They do not contain any personal data. You can find out more in our privacy policy." - box on pageload with no option except "Got It"

Not a great first impression...

Correct me of I'm wrong, but you only need that box if you share cookie data with third parties, set third party cookies, or use cookies for non-primary business purposes (e.g. not just a session token for logged-in page authentication). So seeing any sort of a box like that indicates that you're going doing something nefarious and against the key differentiator of your product (privacy).

Also, the fact that there's no option to decline is a big giant red flag.

diafygi··on Looking Back at the Snowden Revelations
From the post:

> Some of the top-level indicators are surprisingly healthy. HTTPS adoption has taken off like a rocket, driven in part by Google’s willingness to use it as a signal for search rankings — and the rise of free Certificate Authorities like LetsEncrypt. It’s possible that these things would have happened eventually without Snowden, but it’s less likely.

> End-to-end encrypted messaging has also taken off like a rocket, largely due to adoption by WhatsApp and a host of relatively new apps. It’s reached the point where law enforcement agencies have begun to freak out, as the slide below illustrates.

The engineering and technology culture around security and product development has certainly changed. The IETF even adopted "Pervasive Monitoring Is an Attak"[1] as a best current practice.

[1]: https://tools.ietf.org/html/rfc7258

diafygi··on Podcast sponsorship revenue continues to fuel NPR’s financial growth
I have mixed feelings about this, since on several NPR podcasts Exxon has sponsored and advertised their carbon capture investment, despite it being a greenwashing campaign that comprises such a tiny percent of their overall new investment.

How can NPR not ultimately be captured by corporate interests with for-profit sponsorships?

diafygi··on Facebook launches Portal TV, a $149 video chat set-top box
For a company with both a horrible track record on privacy and an incredibly strong monetary incentive to monitor its users, I'm curious if engineers like yourself understand that eventually this product will morph into a tool of mass surveillance? Every time Facebook has pitched a product as "Private by design" it eventually gets tapped as a new data source (see WhatsApp, etc.).

Most people in this thread are saying, essentially, "Fool me once..." But I'm curious to know if engineers internal to Facebook are aware they are in the same situation, where the privacy assurances by the company will eventually get usurped by its thirst for data. Or do you acknowledge that will happen and just see yourself as a mercenary?

← PreviousPage 2 of 26Next →