File tree Expand file tree Collapse file tree 8 files changed +44
-8
lines changed Expand file tree Collapse file tree 8 files changed +44
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,16 @@ Release notes
2
2
=============
3
3
4
4
5
+ Version v33.6.3
6
+ ----------------
7
+
8
+ - We updated RTD build configuration.
9
+ - We added importer for OSS-Fuzz.
10
+ - We removed vulnerabilities with empty aliases.
11
+ - We fixed search encoding issue https://github.com/nexB/vulnerablecode/issues/1336.
12
+ - We added middleware to ban "bytedance" user-agent.
13
+
14
+
5
15
Version v33.6.2
6
16
----------------
7
17
Original file line number Diff line number Diff line change 1
1
[metadata]
2
2
name = vulnerablecode
3
- version = 33.6.2
3
+ version = 33.6.3
4
4
license = Apache-2.0 AND CC-BY-SA-4.0
5
5
6
6
# description must be on ONE line https://github.com/pypa/setuptools/issues/1390
Original file line number Diff line number Diff line change 8
8
#
9
9
10
10
from vulnerabilities .improvers import valid_versions
11
- from vulnerabilities .improvers import vulnerability_status
11
+
12
+ # from vulnerabilities.improvers import vulnerability_status
12
13
13
14
IMPROVERS_REGISTRY = [
14
15
valid_versions .GitHubBasicImprover ,
24
25
valid_versions .DebianOvalImprover ,
25
26
valid_versions .UbuntuOvalImprover ,
26
27
valid_versions .OSSFuzzImprover ,
27
- vulnerability_status .VulnerabilityStatusImprover ,
28
+ # vulnerability_status.VulnerabilityStatusImprover,
28
29
]
29
30
30
31
IMPROVERS_REGISTRY = {x .qualified_name : x for x in IMPROVERS_REGISTRY }
Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright (c) nexB Inc. and others. All rights reserved.
3
+ # VulnerableCode is a trademark of nexB Inc.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+ # See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6
+ # See https://github.com/nexB/vulnerablecode for support or download.
7
+ # See https://aboutcode.org for more information about nexB OSS projects.
8
+ #
9
+
10
+ from django .http import HttpResponseNotFound
11
+ from django .utils .deprecation import MiddlewareMixin
12
+
13
+
14
+ class BanUserAgent (MiddlewareMixin ):
15
+ def process_request (self , request ):
16
+ user_agent = request .META .get ("HTTP_USER_AGENT" , None )
17
+ if user_agent and "bytedance" in user_agent :
18
+ return HttpResponseNotFound (404 )
Original file line number Diff line number Diff line change 1
1
< nav class ="pagination is-centered is-small " aria-label ="pagination ">
2
2
{% if page_obj.has_previous %}
3
- < a href ="?page={{ page_obj.previous_page_number }}&search={{ search }} " class ="pagination-previous "> Previous</ a >
3
+ < a href ="?page={{ page_obj.previous_page_number }}&search={{ search|urlencode }} " class ="pagination-previous "> Previous</ a >
4
4
{% else %}
5
5
< a class ="pagination-previous " disabled > Previous</ a >
6
6
{% endif %}
7
7
8
8
{% if page_obj.has_next %}
9
- < a href ="?page={{ page_obj.next_page_number }}&search={{ search }} " class ="pagination-next "> Next</ a >
9
+ < a href ="?page={{ page_obj.next_page_number }}&search={{ search|urlencode }} " class ="pagination-next "> Next</ a >
10
10
{% else %}
11
11
< a class ="pagination-next " disabled > Next</ a >
12
12
{% endif %}
13
13
14
14
< ul class ="pagination-list ">
15
15
{% if page_obj.number != 1%}
16
16
< li >
17
- < a href ="?page=1&search={{ search }} " class ="pagination-link " aria-label ="Goto page 1 "> 1</ a >
17
+ < a href ="?page=1&search={{ search|urlencode }} " class ="pagination-link " aria-label ="Goto page 1 "> 1</ a >
18
18
</ li >
19
19
{% if page_obj.number > 2 %}
20
20
< li >
32
32
</ li >
33
33
{% endif %}
34
34
< li >
35
- < a href ="?page={{ page_obj.paginator.num_pages }}&search={{ search }} " class ="pagination-link " aria-label ="Goto page {{ page_obj.paginator.num_pages }} "> {{ page_obj.paginator.num_pages }}</ a >
35
+ < a href ="?page={{ page_obj.paginator.num_pages }}&search={{ search|urlencode }} " class ="pagination-link " aria-label ="Goto page {{ page_obj.paginator.num_pages }} "> {{ page_obj.paginator.num_pages }}</ a >
36
36
</ li >
37
37
{% endif %}
38
38
</ ul >
Original file line number Diff line number Diff line change @@ -743,3 +743,9 @@ def test_with_invalid_cpes(self):
743
743
content_type = "application/json" ,
744
744
).json ()
745
745
assert response == {"Error" : "Invalid CPE: CVE-2022-2022" }
746
+
747
+
748
+ class TesBanUserAgent (TestCase ):
749
+ def test_ban_request_with_bytedance_user_agent (self ):
750
+ response = self .client .get (f"/api/packages" , format = "json" , HTTP_USER_AGENT = "bytedance" )
751
+ assert 404 == response .status_code
Original file line number Diff line number Diff line change 12
12
import warnings
13
13
from pathlib import Path
14
14
15
- __version__ = "33.6.2 "
15
+ __version__ = "33.6.3 "
16
16
17
17
18
18
def command_line ():
Original file line number Diff line number Diff line change 89
89
"django.contrib.auth.middleware.AuthenticationMiddleware" ,
90
90
"django.contrib.messages.middleware.MessageMiddleware" ,
91
91
"django.middleware.clickjacking.XFrameOptionsMiddleware" ,
92
+ "vulnerabilities.middleware.ban_user_agent.BanUserAgent" ,
92
93
)
93
94
94
95
ROOT_URLCONF = "vulnerablecode.urls"
You can’t perform that action at this time.
0 commit comments