frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

The Promised LAN

https://tpl.house/
96•Bogdanp•1h ago•11 comments

Trip to moon required Apollo 11 crew to sign US Customs declaration to enter US

https://magazine.uc.edu/editors_picks/recent_features/armstrong/moonrocks.html
167•ajuhasz•3h ago•118 comments

Cara – High Precision Robot Dog Using Rope

https://www.aaedmusa.com/projects/cara
72•hakonjdjohnsen•1h ago•19 comments

How to increase your surface area for luck

https://usefulfictions.substack.com/p/how-to-increase-your-surface-area
20•jger15•28m ago•3 comments

Hyperpb: 10x faster dynamic Protobuf parsing that's faster than generated code

https://buf.build/blog/hyperpb
28•bhollis•1h ago•3 comments

Stop Building AI Tools Backwards

https://hazelweakly.me/blog/stop-building-ai-tools-backwards/
144•eternalreturn•4h ago•102 comments

What to Expect from Debian/Trixie

https://michael-prokop.at/blog/2025/07/20/what-to-expect-from-debian-trixie-newintrixie/
129•exiguus•5h ago•60 comments

FastVLM: Efficient Vision Encoding for Vision Language Models

https://machinelearning.apple.com/research/fast-vision-language-models
22•2bit•2h ago•1 comments

Show HN: The missing link of a bookstore's tech stack

https://bookhead.net/
49•greenie_beans•3h ago•9 comments

UdeM researchers confirm a fifth potentially habitable planet around L 98-59

https://nouvelles.umontreal.ca/en/article/2025/07/22/a-udem-team-confirms-a-fifth-potentially-habitable-planet-around-l-98-59-a-red-dwarf-35-l/
15•layer8•1h ago•0 comments

Optery (YC W22) Is Hiring in Engineering, Legal, Sales, Marketing (U.S., Latam)

https://www.optery.com/careers/
1•beyondd•2h ago

You can now disable all AI features in Zed

https://zed.dev/blog/disable-ai-features
370•meetpateltech•3h ago•168 comments

Interactive Programming in C (2014)

https://nullprogram.com/blog/2014/12/23/
10•ofalkaed•2h ago•0 comments

SIMD Perlin Noise: Beating the Compiler with SSE

https://scallywag.software/vim/blog/simd-perlin-noise-i
28•homarp•2d ago•7 comments

Manticore Search: Fast, efficient, drop-in replacement for Elasticsearch

https://github.com/manticoresoftware/manticoresearch
76•klaussilveira•6h ago•32 comments

Checklists are hard (but still a good thing)

https://utcc.utoronto.ca/~cks/space/blog/sysadmin/ChecklistsAreHardButGood
20•zdw•3d ago•11 comments

Employee – CEO pay gap historically wide

https://www.cnn.com/2025/07/23/business/afl-cio-executive-paywatch-report
19•e12e•42m ago•1 comments

The First Photograph Ever Taken (1826)

https://www.openculture.com/2025/07/the-first-photograph-ever-taken.html
5•anyonecancode•2d ago•0 comments

Cerebras launches Qwen3-235B, achieving 1.5k tokens per second

https://www.cerebras.ai/press-release/cerebras-launches-qwen3-235b-world-s-fastest-frontier-ai-model-with-full-131k-context-support
319•mihau•8h ago•132 comments

The Surprising gRPC Client Bottleneck in Low-Latency Networks

https://blog.ydb.tech/the-surprising-grpc-client-bottleneck-in-low-latency-networks-and-how-to-get-around-it-69d6977a1d02
58•eivanov89•6h ago•10 comments

Using Radicle CI

https://radicle.xyz/2025/07/23/using-radicle-ci-for-development
72•aiw1nt3rs•6h ago•28 comments

Geocities Backgrounds

https://pixelmoondust.neocities.org/archives/archivedtiles/backgroundsindex
128•marcodiego•2d ago•35 comments

Reverse engineering GitHub Actions cache to make it fast

https://www.blacksmith.sh/blog/cache
114•tsaifu•6h ago•27 comments

Tram Trains

https://www.worksinprogress.news/p/tram-trains
31•ortegaygasset•4h ago•20 comments

Proxmox Donates €10k to the Perl and Raku Foundation

https://www.perl.com/article/proxmox-donates-to-tprf/
239•oalders•4h ago•136 comments

AI groups spend to replace low-cost 'data labellers' with high-paid experts

https://www.ft.com/content/e17647f0-4c3b-49b4-a031-b56158bbb3b8
158•eisa01•3d ago•70 comments

Reversing a Fingerprint Reader Protocol (2021)

https://blog.th0m.as/misc/fingerprint-reversing/
46•thejj100100•3d ago•10 comments

SQL Injection as a Feature

https://idiallo.com/blog/sql-injection-as-a-feature
84•foxfired•2d ago•33 comments

Show HN: Self-updating MCP server for official pip, uv, poetry and conda docs

https://github.com/KemingHe/python-dependency-manager-companion-mcp-server
19•keminghe•4h ago•11 comments

Checking Out CPython 3.14's remote debugging protocol

https://rtpg.co/2025/06/28/checking-out-sys-remote-exec/
67•ingve•9h ago•13 comments
Open in hackernews

SQL Injection as a Feature

https://idiallo.com/blog/sql-injection-as-a-feature
84•foxfired•2d ago

Comments

adontz•7h ago
What people often don't realize is that in a big business system a user may have no permission to raw data of some table, but may have permission to report which includes aggregated data of the same table, so report permissions cannot be deducted from base CRUD permissions.

If such SIAAS

    - Checks that query is SELECT query (can be tricky with CTE, requires proper SQL parser)
    - Allows editing said query by superuser only
    - Can be parametrized, including implicit $current_user_id$ parameter
    - Has it's own permissions and users can run the query if they have permissions
It's safe enough. I've seen and applied such "Edit raw SQL in HTML form" many times. It's super flexible, especially combined with some CSV-to-HTML, CSV-to-PDF, or CSV-to-XLS rendering engine.
leprechaun1066•6h ago
Most applications backed kdb+ do just this. It comes with its own parser and you can query tables using something like an ast.

For example the user might ask for data with the constraint

  where TradingDesk=`Eq, AvgPx>500.0
which kdb+ parses into

  ((=;`TradingDesk;(),`Eq);(>;`AvgPx;500.0))
As a dev on the system I can then have a function which takes in this constraint and a list of clients that I want to restrict the result to. That list of clients could come from another function related to the entitlements of the user who made the request:

  applyClientRestriction:{[constraint;clients] constraint,enlist(in;`Client;enlist clients)}
Which results in an extension of the constraint like this for two clients A and B:

  q)applyClientRestriction[((=;`TradingDesk;(),`Eq);(>;`AvgPx;500.0));`ClientA`ClientB]
  ((=;`TradingDesk;enlist`Eq);(>;`AvgPx;500.0);(in;`Client;enlist`ClientA`ClientB))
Then that gets passed to the function which executes the query on the table (kdb+ supports querying tables in a functional manner as well as with a structured query language) and the result has the restrictions applied.

It's really nice because, once parsed, it's list processing like in a lisp and not string processing which is a pain.

indigo945•4h ago
> - Checks that query is SELECT query (can be tricky with CTE, requires proper SQL parser)

Not only is this difficult parsing-wise, there's also no reason to assume that a select query is read-only even when no CTE or subqueries are involved. Function calls in the select clause can also write data.

> - Has it's own permissions and users can run the query if they have permissions

This is the important one. If the role the query runs as doesn't have write permissions on any table, then the user can't write data, period.

Note that this is often not as easy to implement as it seems. For example, in PostgreSQL, neither set role nor set session authorization actually prevent the user from doing malicious things, because the user can just reset role or reset session authorization in the query. For PostgreSQL to properly respect a role's permissions, the SIAAS needs to actually connect to the database as that role.

Common GUC-based row level security approaches are also incompatible with this idea.

kogus•3h ago
I'm not sure what database platform they used, but in SQL Server, functions cannot have side-effects.

https://learn.microsoft.com/en-us/sql/relational-databases/u...

Tostino•3h ago
In Postgres they absolutely can. They are all just happening inside the same transaction scope unlike stored procedures.
chasil•1h ago
Dear SQL Server user, welcome to the world of SQL/PSM.

https://en.wikipedia.org/wiki/SQL/PSM

Within this ADA-esque world, packages, procedures, and functions may initiate DML.

Assuming these objects are in the default "definer rights" context, the DML runs with the full privilege of the owner of the code (this can be adjusted to "invoker rights" with a pragma).

Perhaps this is why Microsoft ignores it (as Sybase did before it).

Tostino•3h ago
Hell, your user can have no write access at all, but the function or procedure can be using SECURITY DEFINER and the code inside it will run with the permissions of the function owner rather than the calling user allowing writes to happen.

Trusting a select to be read only is naive.

LikesPwsh•7h ago
Giving analysts direct SQL access can be great, but you should tell them to use an IDE rather than trying to build your own IDE in a text box.
dsego•6h ago
There are neat online tools like Redash, you connect it to your db and have user logins and you can build reports, parametric dashboards or just do plain queries.
codingdave•7h ago
I've been in scenarios when such UIs existed. But they always were protected so that only system admins had access to it, as a way to let them make quick queries in-app instead of having to pull up other tools. There was no additional access granted, it was just a question of UX, and we expected that anything beyond a simple ad-hoc query would be done with real tools, not in the app.

Also, the underlying databases were secured. Just because you can send a query to a database does not mean you are exposing additional data - database-level security exists and works well.

Rygian•7h ago
If I had to greenlight such a UI, here's my list of non-negotiables:

- Each human user has to use their own dedicated account.

- Every query leaves a trail that can't be tampered with.

- If the database contains sensitive data (personal info, payment data, ...) then the database provides a snapshot guarantee, so that we can inspect whose personal data/payment data were leaked by query X executed at instant T by a bad actor.

- List of humans who can access the feature is vetted regularly.

- Any access that can modify the data in database requires at least two separate humans to agree on the query before it can run.

- Any query that can hamper application throughput is either forbidden, happens on a replica database, or requires at least two separate humans to agree before it can run.

SoftTalker•4h ago
Back in the first dotcom era I worked at a place that had a "SQL page" in the website. Just a textarea where you could enter any query and run it. It was wide open, protected only by the fact that it wasn't linked anywhere (there was no way to get to it other than entering the URL directly into the browser). It was there for the reasons you list, a quick way to verify that the database connections were working and to run ad-hoc queries for support/troubleshooting.

It was thought to be safe enough, because "nobody could guess" the URL of that page.

zihotki•7h ago
When I worked on a similar functionality, I used sql parser and AST walker to verify that no mutations are done and only a subset of sql was whitelisted. That worked as a charm and it wasn't hard to implement. Benefits - no sql injections, cheap syntax check.
supriyo-biswas•7h ago
A similar approach that I used for an application is to take a simplified query language as input such as `name*~"john" emp_id>3000` and use a hand-crafted parser to turn it into a SQL query.
tootubular•6h ago
I just shipped a feature exactly like this... Jira has the same thing with JQL, which is what inspired my work. Safe from SQL injection and can be used directly by power users or managed through form inputs for basic search/filtering. We use Elasticsearch for other data atm, but I'm hopeful this new PostgreSQL only approach wins out as it makes authz so much simpler since it all composes into one query.
emmelaich•6h ago
That exists as @apenwarr's afterquery: https://apenwarr.ca/log/20121218

As it is the URL string, you can share it easily.

ivanjermakov•7h ago
> In the code, someone added a string search for INSERT, UPDATE, and CREATE. If any of these strings were detected, the page returned an unauthorized response.

STRING SEARCH? If only there was a way to limit connection privileges to read-only DML.

sgarland•6h ago
> read-only DML

Technically DQL, if you want to be pedantic.

lenkite•6h ago
Gave analysts a workspace of their own with a SQLite snapshot copy of the main db. They could do whatever they liked with that copy with the tool of their choice.
louis_saglio•6h ago
This is actually what SQL was intended for.
crazygringo•4h ago
It's easy in most modern multiuser databases to restrict a database user to SELECT privileges only, and to set a query timeout of something like 5 seconds (or 30 or whatever is appropriate), right?

Then the queries can be run only using that database user, and there's no risk of INSERT/UPDATE/DELETE. Injection isn't possible. And you can limit access to only the relevant tables as well, so you can't accidentally leak PII.

drysart•4h ago
Most ancient databases can do it too. It's been a standard feature of databases for decades.

It's a little horrifying seeing the hoops people are jumping through to solve a problem that's more quickly, more easily, and more fully solved with your database of choice's equivalent of a CREATE USER statement; and maybe creating some views on tables if you have a need to hide individual columns from users.

chasil•51m ago
No, a user that is only granted SELECT may write to the database.

The trivial example is sorting.

A more nuanced example, in the world of Oracle, is block cleanout. A block may be encountered that has been modified by a past transaction where the commit status is not immediately known; the query session is responsible for either updating the (confirmed) commit status, or rolling back the block from the UNDO/rollback disk image.

So readers always write, likely in every database to some degree.

heckintime•4h ago
At this point, it'd be easier to give your users access to DBeaver or Bigquery directly. Also limiting their access to certain views with prepared data to avoid expensive queries.

For a UI based SQL tool I've used Looker few years ago and thought it was ok. I wonder how much AI tooling Google added since then to help with LookML generation. There are also other open source tools like mathesar (https://github.com/mathesar-foundation/mathesar) which look promising.

EGreg•3h ago
Some of my clients actually wanted to be able to make arbitrary queries in the database.

And this isn't just about SQL queries. Often, people want to be able to make privileged changes to json config files, etc. etc.

So, I added a feature to the Qbix framework, to do just that. Essentially you have some privileged payloads, signed off by an Auditor role with their private key. You might even require M of N keys.

Then, for each Target (e.g. a database) you can use an ACL or Roles+Permissions for who can actually execute the payload against it.

This can be used on:

  * Smart Contracts

  * SQL Queries on Databases

  * Upgrade Scripts on Nix machines

  * Updates on package managers (versions that were vetted)
and much more.

Usually, when you have a bunch of "n00bs" who shouldn't be trusted with X, you want to set up a class of Auditors who sign off on the latest changes, and then a class of Admins who manage the roles, including Auditors and Users.

You don't need sys admins or dev ops. Just have standard container images / AMIs etc. and support only those. Don't even allow ssh into the instance, if you can help it. Let the instance be a pristine environment (Trusted Execution Environment) and discover arbitrary updates at well-known URLs, such as on github. You can have mirrors and fallbacks, but the key is that M of N Auditors from the organization's whitelist have signed off on the arbitrary code of any upgrade, whether delivered via a package manager or a git post-commit hook.

And all updates become automatic, and available to the n00bs to use. Role-based access is always enforced per-target when they attempt to use it. Inside the black box you can use simple HMAC to verify authorizations it issued earlier.

It took me a while to understand this, but the only way to solve security is to either have "pristine environments" that can run arbitrary code but always check M of N signatures for updates, with "byzantine fault tolerant consensus" on top. In the first one, you have to trust cloud providers. For the second one, you sacrifice some privacy. (e.g. with the new FreeNet's smart contracts).

PS: the M of N signatures might have to be hardened against quantum computers, so rather than using elliptic curve cryptography you might want to use lattice-based or my favorite quantum-resistant approach: SPHINCS+ based on Lamport signatures.

EvanAnderson•3h ago
I am reminded of a Customer's grown up "tribal knowledge" around a long-unsupported custom application.

Typically and sadly, the developer used string concatenation to build queries. Some users figured out (or, perhaps, saw the developer do it) they could abuse "filter" fields in the Win32 thick-client application to get filtering functionality the client otherwise didn't offer.

Contrived example: AR aging report doesn't allow for filtering by Customer city. It does allow filtering by Customer name. In the Customer name filter box enter "' OR [City] = 'Boston" to get an AR aging report for only Boston customers.

The users had built-up a Word document with various magical incantations to get data they couldn't otherwise get.

I was impressed by the ingenuity even though it was all horrifying. (The application ran as the database server's superuser-equivalent with the password hard-coded in the client, so nothing was stop somebody from completely trashing the server. >sigh<)

draw_down•3h ago
Hey, if you can know that your users are not adversarial and are capable of writing queries, I say let 'em! The problem is really in that last bit.
ep103•2h ago
SWIM worked as a PM at a company that decided to redo their UI. They ran into an issue on internal roll out, where they discovered their support team for years had been doing sql injection on a specific form in the UI, in order to run reports on the company's database. They had to stop the roll out, and productionize the support team's (very valid) use cases in order to remove the sql injection form.
wvbdmp•1h ago
>(The application ran as the database server's superuser-equivalent with the password hard-coded in the client

I was shocked to find that this seems to be the norm, at least in B2G. Development shops “recommend” it and IT depts are relieved if they can get the invariably batshit arcane on-prem deployments to work at all.

fifticon•3h ago
Why did the story end with a reference to "the machine fired me" essay (which I assume to be fiction, though admittedly funny and soon to be AI reality).

Is he implying, that tampering with the devil's query engine would get him escorted out of the building, or just trying to hook me up on the next story?

zerocrates•2h ago
That essay doesn't read as fiction to me.
zX41ZdbW•46m ago
I use the approach of public apps built on top of free-form SQL queries. Examples:

https://adsb.exposed/ - type any query and get a visualization.

https://play.clickhouse.com/ - explore the database as you want without logging in.

dml2135•17m ago
Ha, this reminds me of a story from my old job, before I became a software engineer.

I worked for an artist and we had an inventory system that a freelance web developer had built for us. I think it was some sort of php, laravel, mysql stack. There was a search bar that you could use to bring up records of artworks.

Everyone at the studio used this system but I was the main person that used it. Over time, I picked up some little tricks here and there. These were useful because engaging this freelance guy for new features involved a lot of back and forth, so if I could find my own improvement to a workflow that was always the easier option.

We didn't have a clear way to pull up works for a single decade. Until I somehow discovered that you could use `%` as a wildcard character in some cases, so I could pull up paintings from the 1970s but searching for `197%`, for example.

I remember proudly telling this to the freelance dev at one point and his eyes widened and he almost looked panicked. In retrospect I recognize that he was thinking about whether he left the system open to an injection attack.

By the end of my job there I had learned enough about this to realize it was a risk but didn't get curious enough to see if a `; DROP TABLE` query would work.