Live data from Hacker News

Property-Based Testing Caught a Security Bug I Never Would Have Found

kiro.dev

21–30 of 40 posts

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#21
post #19

Earlier quoted context omitted.

This just can't be your answer to everything... the article clearly stated that they're developing a client application for browsers. Rust advocates like yourself are really doing more harm than good by ignoring real world constraints.

You can use Rust to develop client application for browsers. Check out dioxus.

Rust is an unergonomic language that slows development in the general case (because it has lots of arcane syntax and rules, and people generally don't know it). Suggesting it as the "obvious" choice ignores the tradeoffs that come with adopting it for a project.

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#22

Earlier quoted context omitted.

You can use Rust to develop client application for browsers. Check out dioxus.

Rust is an unergonomic language that slows development in the general case (because it has lots of arcane syntax and rules, and people generally don't know it). Suggesting it as the "obvious" choice ignores the tradeoffs that come with adopting it for a project.

You can just hire people who know Rust. One Rust developer would likely end up more productive than ten Cursor baby sitters in the long run, and you would actually get a high quality app.

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#24

> We write unit tests for the happy path, maybe a few edge cases we can imagine, but what about the inputs we'd never consider? Many times we assume that LLMs are handling these scenarios by default, Do we?

The original claim for TDD is your write tests for all your edge cases. It doesn't matter about inputs you didn't consider because they are covered in the edge. If you can only accept inputs from 2-7 (inclusive) you check 1,2,7,8 - if those pass you assume the rest work.

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#25

TL;DR: obj[key] with user-controlled key == "__proto__" is a gift that keeps on giving; buy our AI tool that will write subtle vulnerabilities like that which you yourself won’t catch in review but then it will also write some property-based tests that maybe will

Didn't react just have basically the same vuln

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#26
post #19

This kind of bug would never have happened if you used a proper programming language like Rust.

This just can't be your answer to everything... the article clearly stated that they're developing a client application for browsers. Rust advocates like yourself are really doing more harm than good by ignoring real world constraints.

To be fair, this particular issue wouldn't have happened in C, Python, Forth, Zig, or a host of other languages. String-based weirdness is something of a JS issue.

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#27

Earlier quoted context omitted.

Rust is an unergonomic language that slows development in the general case (because it has lots of arcane syntax and rules, and people generally don't know it). Suggesting it as the "obvious" choice ignores the tradeoffs that come with adopting it for a project.

You can just hire people who know Rust. One Rust developer would likely end up more productive than ten Cursor baby sitters in the long run, and you would actually get a high quality app.

This is like some kind of psy-op to get people to hate rust.

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#28
post #26
post #19

Earlier quoted context omitted.

This just can't be your answer to everything... the article clearly stated that they're developing a client application for browsers. Rust advocates like yourself are really doing more harm than good by ignoring real world constraints.

To be fair, this particular issue wouldn't have happened in C, Python, Forth, Zig, or a host of other languages. String-based weirdness is something of a JS issue.

This particular issue looks to be pretty uniquely a javascript problem. I don't even think hyper flexible languages like Ruby would ultimately experience this sort of problem.

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#29

Earlier quoted context omitted.

You can just hire people who know Rust. One Rust developer would likely end up more productive than ten Cursor baby sitters in the long run, and you would actually get a high quality app.

This is like some kind of psy-op to get people to hate rust.

Sure. Then good companies will be able to filter out people by only hiring those who know Rust.

Re: Property-Based Testing Caught a Security Bug I Never Would Have Found

#30
post #24

> We write unit tests for the happy path, maybe a few edge cases we can imagine, but what about the inputs we'd never consider? Many times we assume that LLMs are handling these scenarios by default, Do we?

The original claim for TDD is your write tests for all your edge cases. It doesn't matter about inputs you didn't consider because they are covered in the edge. If you can only accept inputs from 2-7 (inclusive) you check 1,2,7,8 - if those pass you assume the rest work.

You forgot 0, -1, null, "1".
Post reply on HN