News for hackers. Stuff that matters.
Re:Self-obfuscating value objects in PHP by biryani_chicken on Sunday February 27, 2022 @12:09AM (#30485607)
Sounds like it would be a good idea to get the CI process to check for usage of debugging functions. I'm sure it would be possible to write a phpstan rule to forbid var_dump. Maybe another solution would be to make them noops on production.
Re:Self-obfuscating value objects in PHP by Master_Odin on Sunday February 27, 2022 @08:19AM (#30488139)
Re:Self-obfuscating value objects in PHP by mschuster91 on Sunday February 27, 2022 @07:19AM (#30487682)
> Maybe another solution would be to make them noops on production.

There is a way, but it's dangerous: https://www.php.net/manual/en/function.runkit7-function-rede...

Re:Self-obfuscating value objects in PHP by progre on Sunday February 27, 2022 @02:27AM (#30486171)
Slightly off topic, but when I was debugging a release pipeline in Azure Devops I discovered that they do a surprisingly good job of keeping secret values out of the logs: I was trying to dump a connection string with inline powershell but found that it was always masked with **. I had to resort to base64 encode the connection string to get it to print. I suppose they scan the output buffer and compare it with known secrets before printing.
Re:Self-obfuscating value objects in PHP by egeozcan on Sunday February 27, 2022 @04:22AM (#30486667)
Ah, stuff like this always reminds me the famous (or rather infamous?) hunter2 (or rather *******?) conversation:

http://bash.org/?244321

Re:Self-obfuscating value objects in PHP by pdenton on Sunday February 27, 2022 @03:29AM (#30486442)
From TFA:

    > an interface, which cannot implement or inherit from other interfaces
An interface in PHP most definitely can extend multiple other interfaces.
Re:Self-obfuscating value objects in PHP by heythere22 on Sunday February 27, 2022 @04:31AM (#30486709)
> This subtle nuance (value equivalency versus object equivalency) can cause problems, particularly if variables are passed by reference to any other functions in your codebase.

Value objects may be great for leveraging the type system to help you write better code by e.g. having only one place for validation. But why should you pass scalar variables by reference? That makes it really hard to reason about what functions and methods do.

Re:Self-obfuscating value objects in PHP by withinboredom on Sunday February 27, 2022 @11:40AM (#30489955)
There’s an RFC in discussion to add a Sensitive Value attribute that would prevent values from being output in the logs. It won’t stop serialization of the values though.