TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Flarum.org Security Breach

1 pointsby l2dyover 1 year ago

1 comment

theamkover 1 year ago
Some people say that only programmer skills matter, and that languages like PHP are not intrinsically bad. Or that past-PHP was bad, and the modern PHP is a a fine language. But the language defaults still matter, as this case shows: Look at the official Flarum install instructions [0]<p>&gt; The user that Flarum is running as MUST have read + write access to: The root install directory, so Flarum can edit config.php. The storage subdirectory, so Flarum can edit logs and store cached data.<p>Bam! Instant persistence for malware.. Any remote execution bug is instantly and trivially elevated to permanent remote shell, which also survives code updates and server restarts. Many common security practices are defeated by PHP&#x27;s common habits:<p>- Can you run the thing in docker read-only mode? nope, need to edit config.php, and upload files into &quot;storage&quot;, right next to the main code.<p>- Can you at least check for unexpected changes? Nope, see that config.php again.<p>- Maybe at least sandbox the webapp, so it does not have access to the random backups? Nope, while it&#x27;s possible in PHP this is super uncommon, and impossible in common case (apache&#x27;s mod_php).<p>In most other languages&#x2F;ecosystems, saying &quot;let&#x27;s give our webapp user access to modify program files&quot; will be rejected as horribly insecure. Attacker could still exfiltrate data via code injection, or achieve persistence but they&#x27;ll have to work hard for this. Not so in the &quot;modern&quot; PHP apps.<p>Stay away from PHP, folks, if you value security at all.<p>[0] <a href="https:&#x2F;&#x2F;docs.flarum.org&#x2F;install#folder-ownership" rel="nofollow noreferrer">https:&#x2F;&#x2F;docs.flarum.org&#x2F;install#folder-ownership</a>