Zum Hauptinhalt springen
LIVE
CVSS 6.9CVE-2026-138105 | A vulnerability has been found in ssssssss-team magic-api 2.2.2. The affected element is an unknown function of the file /magic/web/datasource/jdbc/test of the component Datasource JDBC Test Endpoint. Such manipulation of the argument driverClassName leads to code injection. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. The project was informed of the problem early through an issue report but has not respoCVSS 6.9CVE-2026-138104 | A flaw has been found in ssssssss-team magic-api up to 2.2.2. Impacted is the function push of the file magic-api/src/main/java/org/ssssssss/magicapi/core/web/MagicWorkbenchController.java of the component Workbench Push Interface. This manipulation of the argument magic-push-target causes server-side request forgery. The attack can be initiated remotely. The exploit has been published and may be used. The project was informed of the problem early through anCVSS 6.9CVE-2026-138103 | A vulnerability was detected in ssssssss-team magic-api up to 2.2.2. This issue affects the function saveFile of the file MagicResourceController.java of the component magic-api-core resource save API. The manipulation results in code injection. It is possible to launch the attack remotely. The exploit is now public and may be used. The project was informed of the problem early through an issue report but has not responded yet.CVSS 9.4CVE-2026-138102 | A security vulnerability has been detected in D-Link DIR-620S 4.0.2. This vulnerability affects unknown code of the file /usr/sbin/anweb of the component Diagnostic Handler. The manipulation of the argument I leads to os command injection. It is possible to initiate the attack remotely. The exploit has been disclosed publicly and may be used.CVSS 5.3CVE-2026-138101 | A weakness has been identified in MassGen up to 0.1.97. This affects the function _generate_subagent_yaml_config of the file massgen/subagent/manager.py of the component Subagent Delegation System. Executing a manipulation can lead to improper authorization. The attack may be performed from remote. The exploit has been made available to the public and could be used for attacks. The project was informed of the problem early through an issue report but has notCVSS 6.9CVE-2026-138100 | A security flaw has been discovered in MassGen up to 0.1.97. Affected by this issue is the function __init__ of the file massgen/filesystem_manager/_filesystem_manager.py. Performing a manipulation results in protection mechanism failure. The attack is possible to be carried out remotely. The exploit has been released to the public and may be used for attacks. The project was informed of the problem early through an issue report but has not responded yet.CVSS 8.7CVE-2026-138099 | A vulnerability was identified in Tenda AC10U 1.18.6. Affected by this vulnerability is the function readUsb of the component ATE Service. Such manipulation leads to out-of-bounds write. The attack can be executed remotely. The exploit is publicly available and might be used.CVSS 6.9CVE-2026-138098 | A vulnerability was determined in weison-tech yii2-cms up to 1.0.2. Affected is an unknown function of the file protected/core/config/common.php of the component RBAC Authorization. This manipulation causes improper authorization. Remote exploitation of the attack is possible.
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

The src/ Layout for Hexagonal PHP: Layers and Import Rules

Book: Decoupled PHP — Clean and Hexagonal Architecture for Applications That Outlive the Framework Also by me: Thinking in Go (2-book series) — Complete Guide t…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Quelle & Fakten · 7 Min. Lesezeit
Quelle: dev.to
Rubrik: Sichere Programmierung





You read the hexagonal post, you liked the hexagon diagram, and then you opened your editor and made three folders: Domain, Application, Infrastructure. Good start. Two weeks later a use Doctrine\ORM\EntityManagerInterface sits at the top of a domain entity, and nobody remembers approving it. The folders were a suggestion. Nothing stopped the import.



The layout only matters if the boundaries are enforced. This post gives you the concrete src/ tree, the namespace-to-layer map, the exact directions an import is allowed to point, and the CI check that fails the build when someone points one the wrong way. Target is PHP 8.4+ with Composer PSR-4.






The tree



Three top-level namespaces under src/, mapped one-to-one to three directories.




your-app/
composer.json
src/
Domain/ # pure PHP, no vendor imports
Order/
Order.php
OrderId.php
OrderStatus.php
Customer/
Shared/
Money.php
Application/ # use cases + the ports
Order/
PlaceOrder.php
PlaceOrderInput.php
Port/
OrderRepository.php
PaymentGateway.php
Clock.php
Infrastructure/ # adapters, framework, wiring
Persistence/Doctrine/
Http/Controller/
Payment/Stripe/
Clock/SystemClock.php
Bootstrap/Container.php
tests/






Each ring is a layer. Domain is the center. Infrastructure is the outer edge that touches the world. Application sits between, holding the use cases and the interfaces (ports) the use cases depend on.






The namespace map



One PSR-4 root, three sub-namespaces that shadow the directories exactly.




{
"autoload": {
"psr-4": {
"App\\": "src/"
}
}
}






So src/Domain/Order/Order.php is App\Domain\Order\Order, and the first segment after App\ tells you the layer at a glance. No App\Models, no App\Services, no App\Http scattered across the root. The namespace is the architecture. When you read an import, the second segment answers "which ring does this live in" before you read the class name.



Keep the framework's own namespace out of src/. Symfony's App\Controller convention and Laravel's App\Http both flatten everything into one bag. You want the opposite: the layer is load-bearing, so it goes first.






The import rules



Here is the whole architecture in one table. Rows are the file doing the importing; columns are what it is allowed to import.




































From \ imports Domain Application Infrastructure Vendor
Domain yes no no no
Application yes yes no no*
Infrastructure yes yes yes yes


The rule reads in one direction: imports point inward, never outward. Domain imports only itself. Application imports Domain and itself. Infrastructure imports everything, because it is the layer whose whole job is to translate between the outside world and the inside.



The no* on Application-to-vendor has one carve-out worth naming: PSR interfaces (Psr\Log\LoggerInterface, Psr\Clock\ClockInterface) and pure library value types are sometimes allowed there, because they are contracts, not implementations. Decide it once for the team and encode the decision in the CI config below, so it is not re-argued in every review.



Two consequences fall out of the table:




  • A domain entity that needs now() cannot call new DateTimeImmutable() and stay honest — that is a decision from the outside world. It takes the time as an argument, or the use case reads a Clock port. The Clock interface lives in Application\Port; SystemClock lives in Infrastructure.

  • A use case that needs to save an order depends on App\Application\Port\OrderRepository, an interface. The Doctrine class that implements it lives in Infrastructure and is bound at wiring time. The arrow points from Infrastructure inward to the port, which is exactly what the table allows.






Why the direction matters



The point of pointing imports inward is that the center never has a reason to change when the edge does. Swap Doctrine for raw PDO, Guzzle for the Symfony HTTP client, RabbitMQ for SQS — every one of those edits lands in Infrastructure. The Domain and Application files do not move, because nothing in them names the thing you replaced.



A port makes this concrete. The use case states its need in domain language.




<?php

declare(strict_types=1);

namespace App\Application\Port;

use App\Domain\Order\Order;
use App\Domain\Order\OrderId;

interface OrderRepository
{
public function save(Order $order): void;
public function findById(OrderId $id): ?Order;
}






No EntityManager, no QueryBuilder, no SQL. The adapter that satisfies this interface is free to use all three, because it lives on the outside where vendor imports are legal.




<?php

declare(strict_types=1);

namespace App\Infrastructure\Persistence\Doctrine;

use App\Application\Port\OrderRepository;
use App\Domain\Order\Order;
use App\Domain\Order\OrderId;
use Doctrine\ORM\EntityManagerInterface;

final readonly class DoctrineOrderRepository
implements OrderRepository
{
public function __construct(
private EntityManagerInterface $em,
) {}

public function save(Order $order): void
{
$this->em->persist($order);
}

public function findById(OrderId $id): ?Order
{
return $this->em->find(Order::class, $id->value);
}
}






Read the two files together. The use Doctrine\... line is legal here and illegal one folder over. That is the entire discipline, and folders alone will not hold it.






The CI check that enforces it



Nothing above survives contact with a deadline unless a machine rejects the violation. Two tools do this for PHP. Pick one.



Deptrac maps namespaces to layers and declares which layers may depend on which. A deptrac.yaml for this tree:




deptrac:
paths:
- ./src
layers:
- name: Domain
collectors:
- type: directory
value: src/Domain/.*
- name: Application
collectors:
- type: directory
value: src/Application/.*
- name: Infrastructure
collectors:
- type: directory
value: src/Infrastructure/.*
ruleset:
Domain: ~
Application:
- Domain
Infrastructure:
- Domain
- Application






Domain: ~ means the domain may depend on nothing but itself. Run it in the pipeline:




vendor/bin/deptrac analyse --fail-on-uncovered






Any import that crosses a boundary the ruleset forbids exits non-zero and breaks the build. --fail-on-uncovered also catches a namespace you forgot to assign to a layer, so a new top-level folder cannot sneak past unclassified.



PHPArkitect expresses the same rules as fluent PHP assertions if you prefer code over YAML:




Rule::allClasses()
->that(new ResideInOneOfTheseNamespaces('App\Domain'))
->should(new NotDependsOnTheseNamespaces(
'App\Application',
'App\Infrastructure',
'Doctrine',
'Symfony',
))
->because('the domain stays framework-free');






If you want a zero-dependency smoke test before adding either tool, a grep in CI catches the loudest offenders:




if grep -rlE \
'use (Doctrine|Symfony|GuzzleHttp|Illuminate)' \
src/Domain src/Application; then
echo "vendor import inside Domain/Application"
exit 1
fi






The grep is blunt. It misses transitive dependencies and the PSR carve-outs, so treat it as a stopgap while you wire up Deptrac. The static tool is the real gate. It reads the actual use graph, not a string match, and it fails the exact pull request that introduced the leak, while the reviewer still remembers the context.






Where to start



If you have an existing app, do not rewrite the tree in one branch. Create the three folders, move one aggregate and its use case inside, add the Deptrac config with only that slice covered, and turn on --fail-on-uncovered. The build starts guarding the boundary you just drew. Every following slice inherits the same gate for free, and the day someone adds use Doctrine to a domain class, the pipeline says no before a human has to.



Keeping the framework at the outer edge is a dependency direction, not a folder convention. The direction only holds when a machine checks it on every push. That inversion, the domain that depends on nothing and the framework that depends on everything, is the spine of what Decoupled PHP builds chapter by chapter: ports, adapters, use cases, and the migration path for a Laravel or Symfony app that has to keep shipping while it moves onto this shape.



Decoupled PHP — Clean and Hexagonal Architecture for Applications That Outlive the Framework



Available on Kindle, Paperback, and Hardcover. English, German, and Japanese editions out now — Portuguese and Spanish coming soon.

Information ergänzen Fachhinweis, Update, Korrektur oder Quelle zur Meldung beitragen
Gäste-Hinweise werden kurz redaktionell geprüft und danach hier angezeigt.

Community-Hinweise zur Meldung

0 freigegeben
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:

💬 Community-Diskussion & Kommentare

🌐 Zum Hauptchat

Starte die Diskussion im Social-Chat Broadcast Stream oder reiche oben über „Information ergänzen“ einen Fachbeitrag ein.

Community Rating &amp; Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War dieser Artikel hilfreich?
0
Jetzt Bewertung abgeben
Detail-Bewertung (optional)
Inhalt & Qualität
Quelle & Glaubwürdigkeit
Aktualität
Security Briefing Kostenlos · 1-Klick-Abmeldung

Intelligence Digest — kostenlos

Täglich die wichtigsten Security-News · jederzeit abbestellbar

Verwandte Story-Cluster & Quellen (Vektor-KI)

6 Cluster
25 Quellen
ForgeOS Booted on a Real Server: Linux Kernel Below, Only Our Own Code Above
DEV Community vor 1 Std.
24 weitere Quellen
VulDB Updatesvor 2 Std.CVE-2026-72239 | Linux Kernel sev x86/virt/sev/sev.c wbinvd_on_all_cpus state issue (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72240 | Linux Kernel up to 7.1.4 mfd sm501_register_device memory leak (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72241 | Linux Kernel up to 7.1.4 uleds strchr buffer overflow (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72244 | Linux Kernel up to 6.12.100/6.18.41/7.1.4/7.2-rc2 gpu-buddy allocation of resources (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72243 | Linux Kernel up to 7.2-rc2 selinux socket_sendmsg permission (Nessus ID 364200 / WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72245 | Linux Kernel up to 7.1.4 host1x host1x_device_parse_dt release of resource (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72246 | Linux Kernel flowtable input validation (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72247 | Linux Kernel up to 7.2-rc3 nf_conncount __nf_conncount_add dir comparison (WID-SEC-2026-2852) VulDB Updatesvor 2 Std.CVE-2026-72248 | Linux Kernel up to 7.1.4/7.2-rc2 flowtable nft_flow_dst_release buffer overflow (WID-SEC-2026-2852) LinuxAndUbuntuvor 2 Std.Linux AutoFDO Benchmark: Clang Kernel Optimization FOSS Linuxvor 2 Std.NFS2ROOT: Pre-Auth Flaw in the Linux NFS Server VulDB Updatesvor 3 Std.CVE-2022-31607 | NVIDIA GPU Display Driver on Linux Kernel Mode Layer nvidia.ko input validation (EUVD-2022-53059 / Nessus ID 339047) VulDB Updatesvor 4 Std.CVE-2026-72227 | Linux Kernel up to 6.12.96/6.18.39/7.1.4/7.2-rc2 batman-adv out-of-bounds (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72228 | Linux Kernel up to 7.2-rc2 batman-adv skb_split memory leak (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72229 | Linux Kernel up to 7.2-rc2 batman-adv register_netdevice memory leak (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72231 | Linux Kernel up to 7.2-rc2 batman-adv batadv_send_tt_request allocation of resources (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72230 | Linux Kernel up to 7.2-rc2 batman-adv batadv_frag_send_packet memory leak (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72232 | Linux Kernel up to 7.2-rc2 batman-adv batadv_interface_tx out-of-bounds (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72234 | Linux Kernel up to 7.2-rc1 batman-adv batadv_get_vid use after free (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72233 | Linux Kernel up to 7.2-rc1 batman-adv batadv_bla_is_backbone_gw use after free (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72236 | Linux Kernel up to 7.2-rc3 s390/perf_cpum_cf __hw_perf_event_init config array index (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72235 | Linux Kernel up to 7.2-rc1 batman-adv batadv_interface_rx use after free (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72237 | Linux Kernel up to 7.2-rc2 BRS /x86/amd/brs amd_brs_match_plm information disclosure (WID-SEC-2026-2852) VulDB Updatesvor 4 Std.CVE-2026-72238 | Linux Kernel up to 7.2-rc3 x86 boot early_serial_init integer overflow (WID-SEC-2026-2852)
14 Quellen
Cyber Monday Australia laptop deals for 2026: score up to 52% off Lenovo, Apple, Dell, HP and more
Latest from TechRadar vor 15 Min.
13 weitere Quellen
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten The src/ Layout for Hexagonal PHP: Layers and Import Rules

Thematisch verwandte Begriffe: Layout, Hexagonal, Layers, Import · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Widgets & Themen
Widgets werden geladen…
Nächster Beitrag