fivem icon indicating copy to clipboard operation
fivem copied to clipboard

client-side physics manipulation and illegal entity attachment (LaunchPlayer)

Open Whisperisgod opened this issue 3 months ago • 7 comments

What happened?

Malicious clients are using a custom client-side script (LaunchPlayer) that forces physical attachment (AttachEntityToEntityPhysically) and applies physical impulse (ApplyForceToEntity) to other players or their vehicles. By spoofing local entity control requests and ragdolling target peds, attackers launch nearby players into the air ("yeeting") without server consent. Standard server-side resource checks fail to block this behavior.

Expected result

The server should reject unauthorized physical attachments, force applications, or entity ownership/control transfers initiated by third-party client scripts on players who are not within the same interaction context.

Reproduction steps

Execute the client-side LaunchPlayer function on a target player's Server ID.

Observe the attacker requesting network control of the target ped/vehicle via NetworkRequestControlOfEntity.

Observe the target ped being forced into a ragdoll state.

Observe physical attachment via AttachEntityToEntityPhysically followed by repeated upward force applied via ApplyForceToEntity.

Target player gets launched into the air while the attacker's original position is restored locally.

Importancy

Crash

Area(s)

FiveM

Specific version(s)

B 3095 A 35574

Additional information

Below is the client-side code snippet used to execute this exploit pattern for technical reference:

function LaunchPlayerV3(targetPlayerId)
    if not targetPlayerId then return end
    Citizen.CreateThread(function()
        local originalCoords = nil
        local originalHeading = 0.0
        local needsRestore = false
        local function RestoreSelf()
            if not needsRestore or not originalCoords then return end
            needsRestore = false
            local ped = PlayerPedId()
            if not ped or not DoesEntityExist(ped) then return end
            pcall(function() DetachEntity(ped, true, true) end)
            ClearPedTasksImmediately(ped)
            FreezeEntityPosition(ped, false)
            SetEntityCollision(ped, true, true)
            local cx, cy, cz = originalCoords.x, originalCoords.y, originalCoords.z
            SetEntityCoordsNoOffset(ped, cx, cy, cz + 1.0, false, false, false)
            Citizen.Wait(100)
            SetEntityCoordsNoOffset(ped, cx, cy, cz, false, false, false)
            SetEntityHeading(ped, originalHeading)
            NetworkResurrectLocalPlayer(cx, cy, cz, originalHeading, true, false)
            SetEntityHealth(ped, 200)
            SetEntityMaxHealth(ped, 200)
            ClearPedBloodDamage(ped)
            SetPedCanRagdoll(ped, true)
            SetPedCanRagdollFromPlayerImpact(ped, true)
            SetPlayerInvincible(PlayerId(), false)
            SetEntityInvincible(ped, false)
            SetEntityVisible(ped, true, false)
            ResetEntityAlpha(ped)
            SetEntityVelocity(ped, 0.0, 0.0, 0.0)
            Citizen.Wait(50)
            ClearPedTasksImmediately(ped)
        end
        local ok, err = pcall(function()
            local clientId = GetPlayerFromServerId(tonumber(targetPlayerId))
            if not clientId or clientId == -1 or clientId == PlayerId() then return end
            local targetPed = GetPlayerPed(clientId)
            if not targetPed or not DoesEntityExist(targetPed) then return end
            local myPed = PlayerPedId()
            if not myPed or not DoesEntityExist(myPed) then return end
            originalCoords = GetEntityCoords(myPed)
            originalHeading = GetEntityHeading(myPed)
            needsRestore = true
            local launchEntity = targetPed
            if IsPedInAnyVehicle(targetPed, false) then
                local veh = GetVehiclePedIsIn(targetPed, false)
                if veh and veh ~= 0 and DoesEntityExist(veh) then
                    launchEntity = veh
                end
            end
            ClearPedTasksImmediately(myPed)
            Citizen.Wait(80)
            for i = 1, 6 do
                NetworkRequestControlOfEntity(launchEntity)
                NetworkRequestControlOfEntity(myPed)
                Citizen.Wait(45)
            end
            if launchEntity == targetPed then
                ClearPedTasksImmediately(targetPed)
                SetPedCanRagdoll(targetPed, true)
                pcall(function() SetPedCanRagdollFromPlayerImpact(targetPed, true) end)
                SetPedToRagdoll(targetPed, 5000, 5000, 0, false, false, false)
                Citizen.Wait(120)
                pcall(function()
                    SetPedToRagdollWithFall(targetPed, 5000, 5000, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
                end)
                Citizen.Wait(60)
            end
            local targetCoords = GetEntityCoords(launchEntity)
            local found, groundZ = GetGroundZFor_3dCoord(targetCoords.x, targetCoords.y, targetCoords.z + 10.0, false)
            local safeZ = found and (groundZ + 0.5) or (targetCoords.z + 0.5)
            SetEntityVisible(myPed, false, false)
            SetEntityCoords(myPed, targetCoords.x, targetCoords.y, safeZ + 0.35, false, false, false, true)
            Citizen.Wait(180)
            if launchEntity == targetPed then
                pcall(function()
                    AttachEntityToEntityPhysically(
                        myPed, targetPed, 0,
                        0.0, 0.0, 0.0,
                        100.0, 0.0, 0.0,
                        0.0, 0.0, 0.0,
                        1, false, false, true, 2, true
                    )
                end)
                Citizen.Wait(130)
            end
            for i = 1, 3 do
                ApplyForceToEntity(launchEntity, 1, 0.0, 0.0, 100.0, 0.0, 0.0, 0.0, 0, false, true, false, false, true)
                Citizen.Wait(45)
            end
            Citizen.Wait(90)
            pcall(function() DetachEntity(myPed, true, true) end)
            pcall(function() DeleteEntity(myPed, true, true) end)
            Citizen.Wait(150)
            ApplyForceToEntity(launchEntity, 1, 0.0, 0.0, 120.0, 0.0, 0.0, 0.0, 0, false, true, false, false, true)
            Citizen.Wait(200)
            if launchEntity == targetPed then
                pcall(function() ClearPedTasksImmediately(targetPed) end)
            end
            RestoreSelf()
        end)
        if not ok then
            RestoreSelf()
        end
    end)
end
function GetNearestLaunchTarget()
    local myPlayer = PlayerId()
    local myPed = PlayerPedId()
    if not myPed or not DoesEntityExist(myPed) then return nil end
    local myCoords = GetEntityCoords(myPed)
    local closestPlayer = nil
    local closestDistance = nil
    for _, player in ipairs(GetActivePlayers()) do
        if player ~= myPlayer then
            local targetPed = GetPlayerPed(player)
            if targetPed and DoesEntityExist(targetPed) then
                local targetCoords = GetEntityCoords(targetPed)
                local dx = myCoords.x - targetCoords.x
                local dy = myCoords.y - targetCoords.y
                local dz = myCoords.z - targetCoords.z
                local distance = (dx * dx) + (dy * dy) + (dz * dz)
                if not closestDistance or distance < closestDistance then
                    closestDistance = distance
                    closestPlayer = player
                end
            end
        end
    end
    if not closestPlayer then return nil end
    return GetPlayerServerId(closestPlayer)
end

Whisperisgod avatar Aug 31 '26 15:08 Whisperisgod

u can use any server side or client side scanner to detect if player atached to someone or if someone atached to player and do ur check like not carry emote or somthing and then detache and ban and what anticheat do u use ?

xx64qaz avatar Aug 31 '26 17:08 xx64qaz

Herhangi bir sunucu tarafı veya istemci tarafı tarayıcısını kullanarak oyuncunun birine bağlanıp bağlanmadığını veya birinin oyuncuya bağlandığını tespit edebilir ve kontrol yapabilirsiniz, örneğin emote taşımayın, sonra detache yapıp ban ve hangi anticheat'ı kullanıyorsunuz?

electron

Whisperisgod avatar Aug 31 '26 17:08 Whisperisgod

u can use any server side or client side scanner to detect if player atached to someone or if someone atached to player and do ur check like not carry emote or somthing and then detache and ban and what anticheat do u use ?

sample code?

Whisperisgod avatar Aug 31 '26 17:08 Whisperisgod

u can use any server side or client side scanner to detect if player atached to someone or if someone atached to player and do ur check like not carry emote or somthing and then detache and ban and what anticheat do u use ?

sample code?

what ur discord ?

xx64qaz avatar Aug 31 '26 17:08 xx64qaz

u can use any server side or client side scanner to detect if player atached to someone or if someone atached to player and do ur check like not carry emote or somthing and then detache and ban and what anticheat do u use ?

sample code?

what ur discord ?

whisperisgod

Whisperisgod avatar Aug 31 '26 17:08 Whisperisgod

u can use any server side or client side scanner to detect if player atached to someone or if someone atached to player and do ur check like not carry emote or somthing and then detache and ban and what anticheat do u use ?

sample code?

what ur discord ?

you nick?

Whisperisgod avatar Aug 31 '26 17:08 Whisperisgod

whisperisgod

i sent it to u _m77d

xx64qaz avatar Aug 31 '26 17:08 xx64qaz