Exploit database

GH-25ed919a3c63ff26fc49a3fe47dc7565

datackmy/fallingskies-cve-2023-35885

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2023-35885

4 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files50

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

src/Validator/Constraints/PortRangeValidator.php

PHP · 1,282 bytes
<?php

namespace App\Validator\Constraints;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

class PortRangeValidator extends ConstraintValidator
{
    public function validate($value, Constraint $constraint): void
    {
        if (null === $value || '' === $value) {
            return;
        }
        try {
            $portRange = trim($value);
            $portRange = explode('-', $portRange);
            if (count($portRange) == 1) {
                $port = (int)$portRange[0];
                if ($port == 0) {
                    $this->context->buildViolation($constraint->message)->addViolation();
                }
            }
            if (count($portRange) == 2) {
                $fromPort = (int)$portRange[0];
                $toPort = (int)$portRange[1];
                if ($fromPort == 0 || $toPort == 0) {
                    $this->context->buildViolation($constraint->message)->addViolation();
                }
            }
            if (count($portRange) > 2) {
                $this->context->buildViolation($constraint->message)->addViolation();
            }
        } catch (\Exception $e) {
            $this->context->buildViolation($constraint->message)->addViolation();
        }
    }
}