MozillaSecurity / MozillaSecurity/FuzzManager

[CrashManager] testcase_ext given without testcase

Open
#544 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug crashmanager
Dominant language
Python
Stars
208
Forks
48
Avg merge
23h 5m
Merged PRs (30d)
2

Description

Traceback observed during operation:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 483, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 443, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 480, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/mixins.py", line 21, in create
    self.perform_create(serializer)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/mixins.py", line 26, in perform_create
    serializer.save()
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py", line 214, in save
    self.instance = self.create(validated_data)
  File "./crashmanager/serializers.py", line 110, in create
    return super(CrashEntrySerializer, self).create(attrs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py", line 957, in create
    raise TypeError(msg)
TypeError: Got a `TypeError` when calling `CrashEntry.objects.create()`. This may be because you have a writable field on the serializer class that is not a valid argument t
o `CrashEntry.objects.create()`. You may need to make the field read-only, or override the CrashEntrySerializer.create() method to handle this correctly.
Original exception was:
 Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/serializers.py", line 940, in create
    instance = ModelClass.objects.create(**validated_data)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 392, in create
    obj = self.model(**kwargs)
  File "./crashmanager/models.py", line 235, in __init__
    super(CrashEntry, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 573, in __init__
    raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
TypeError: 'testcase_ext' is an invalid keyword argument for this function

I think the fix will be simply clearing testcase_ext in the case when no testcase is given, but I'm not sure how this is actually happening if Collector.submit() is being used.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Collector.submit(), then inspect the CrashEntrySerializer.create path around crashmanager/serializers.py:110 and CrashEntry initialization in crashmanager/models.py:235. Reproduce a submission where testcase_ext is provided without testcase and verify that the request no longer raises the reported invalid-keyword TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.