Language: Python
Label: safe
CWE: NVD-CWE-noinfo \u2014 

Code:
def test_internal_call_kwargs(get_contract, typ1, strategy1, typ2, strategy2):
    # GHSA-ph9x-4vc9-m39g

    @given(kwarg1=strategy1, default1=strategy1, kwarg2=strategy2, default2=strategy2)
    @settings(deadline=None, max_examples=5)  # len(cases) * len(cases) * 5 * 5
    def fuzz(kwarg1, kwarg2, default1, default2):
        code = f"""
@internal
def foo(a: {typ1} = {repr(default1)}, b: {typ2} = {repr(default2)}) -> ({typ1}, {typ2}):
    return a, b

@external
def test0() -> ({typ1}, {typ2}):
    return self.foo()

@external
def test1() -> ({typ1}, {typ2}):
    return self.foo({repr(kwarg1)})

@external
def test2() -> ({typ1}, {typ2}):
    return self.foo({repr(kwarg1)}, {repr(kwarg2)})

@external
def test3(x1: {typ1}) -> ({typ1}, {typ2}):
    return self.foo(x1)

@external
def test4(x1: {typ1}, x2: {typ2}) -> ({typ1}, {typ2}):
    return self.foo(x1, x2)
        """
        c = get_contract(code)
        assert c.test0() == [default1, default2]
        assert c.test1() == [kwarg1, default2]
        assert c.test2() == [kwarg1, kwarg2]
        assert c.test3(kwarg1) == [kwarg1, default2]
        assert c.test4(kwarg1, kwarg2) == [kwarg1, kwarg2]

    fuzz()