Debian Codegraph @

tests/exporters/files/notebook_inject.ipynb

raw
1 {
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": null,
6 "id": "79aede83-fba6-4715-bce6-9f3926b128a2",
7 "metadata": {
8 "tags": [
9 "FOO\"><script>alert('cell_tag')</script><div \""
10 ]
11 },
12 "outputs": [],
13 "source": []
14 },
15 {
16 "cell_type": "raw",
17 "id": "372c2bf1",
18 "metadata": {},
19 "source": [
20 "Payload in raw cell <script>alert('raw cell')</script>"
21 ]
22 },
23 {
24 "cell_type": "markdown",
25 "id": "2d42de4a",
26 "metadata": {},
27 "source": [
28 "<script>alert('markdown cell')</script>"
29 ]
30 },
31 {
32 "cell_type": "code",
33 "execution_count": null,
34 "id": "b72e53fa",
35 "metadata": {},
36 "outputs": [
37 {
38 "data": {
39 "image/svg+xml": [
40 "<script>alert('image/svg+xml output')</script>"
41 ]
42 },
43 "execution_count": null,
44 "metadata": {},
45 "output_type": "execute_result"
46 }
47 ],
48 "source": []
49 },
50 {
51 "cell_type": "code",
52 "execution_count": null,
53 "id": "b72e63fa",
54 "metadata": {},
55 "outputs": [
56 {
57 "data": {
58 "image/png": [
59 ""
60 ]
61 },
62 "execution_count": null,
63 "metadata": {
64 "filenames": {
65 "image/png": "\"><script>alert('png filenames')</script>"
66 }
67 },
68 "output_type": "execute_result"
69 }
70 ],
71 "source": []
72 },
73 {
74 "cell_type": "code",
75 "execution_count": null,
76 "id": "b72e63f3",
77 "metadata": {},
78 "outputs": [
79 {
80 "data": {
81 "image/jpeg": [
82 ""
83 ]
84 },
85 "execution_count": null,
86 "metadata": {
87 "filenames": {
88 "image/jpeg": "\"><script>alert('jpg filenames')</script>"
89 }
90 },
91 "output_type": "execute_result"
92 }
93 ],
94 "source": []
95 },
96 {
97 "cell_type": "code",
98 "execution_count": null,
99 "id": "b72e635a",
100 "metadata": {},
101 "outputs": [
102 {
103 "data": {
104 "image/png": [
105 "\"><script>alert('image/png output')</script>"
106 ]
107 },
108 "execution_count": null,
109 "metadata": {},
110 "output_type": "execute_result"
111 }
112 ],
113 "source": []
114 },
115 {
116 "cell_type": "code",
117 "execution_count": null,
118 "id": "p72e635a",
119 "metadata": {},
120 "outputs": [
121 {
122 "data": {
123 "image/jpeg": [
124 "\"><script>alert('image/jpeg output')</script>"
125 ]
126 },
127 "execution_count": null,
128 "metadata": {},
129 "output_type": "execute_result"
130 }
131 ],
132 "source": []
133 },
134 {
135 "cell_type": "code",
136 "execution_count": null,
137 "id": "d72e635a",
138 "metadata": {},
139 "outputs": [
140 {
141 "data": {
142 "image/png": [
143 "abcd"
144 ]
145 },
146 "execution_count": null,
147 "metadata": {
148 "width": "><script>alert('output.metadata.width png injection')</script>"
149 },
150 "output_type": "execute_result"
151 }
152 ],
153 "source": []
154 },
155 {
156 "cell_type": "code",
157 "execution_count": null,
158 "id": "d72e095a",
159 "metadata": {},
160 "outputs": [
161 {
162 "data": {
163 "image/png": [
164 "abcd"
165 ]
166 },
167 "execution_count": null,
168 "metadata": {
169 "width": [
170 "><script>alert('output.metadata.width png injection')</script>"
171 ]
172 },
173 "output_type": "execute_result"
174 }
175 ],
176 "source": []
177 },
178 {
179 "cell_type": "code",
180 "execution_count": null,
181 "id": "ae4f574d",
182 "metadata": {},
183 "outputs": [
184 {
185 "data": {
186 "image/png": [
187 "abcd"
188 ]
189 },
190 "execution_count": null,
191 "metadata": {
192 "height": "><script>alert('output.metadata.height png injection')</script>"
193 },
194 "output_type": "execute_result"
195 }
196 ],
197 "source": []
198 },
199 {
200 "cell_type": "code",
201 "execution_count": null,
202 "id": "w72e635a",
203 "metadata": {},
204 "outputs": [
205 {
206 "data": {
207 "application/vnd.jupyter.widget-view+json": {
208 "foo": "\"</script><script>alert('output.data.application/vnd.jupyter.widget-view+json injection')//",
209 "model_id": "wid1"
210 }
211 },
212 "execution_count": null,
213 "metadata": {},
214 "output_type": "execute_result"
215 }
216 ],
217 "source": []
218 },
219 {
220 "cell_type": "code",
221 "execution_count": 5,
222 "id": "2616e107",
223 "metadata": {},
224 "outputs": [
225 {
226 "data": {
227 "text/html": [
228 "<script>alert('text/html output')</script>"
229 ]
230 },
231 "execution_count": 5,
232 "metadata": {},
233 "output_type": "execute_result"
234 }
235 ],
236 "source": [
237 "import os\n",
238 "\n",
239 "os.system(\"touch /tmp/pwned\")"
240 ]
241 },
242 {
243 "cell_type": "code",
244 "execution_count": 5,
245 "id": "3616e107",
246 "metadata": {},
247 "outputs": [
248 {
249 "data": {
250 "text/markdown": [
251 "<script>alert('text/markdown output')</script>"
252 ]
253 },
254 "execution_count": 5,
255 "metadata": {},
256 "output_type": "execute_result"
257 }
258 ],
259 "source": [
260 "import os\n",
261 "\n",
262 "os.system(\"touch /tmp/pwned\")"
263 ]
264 },
265 {
266 "cell_type": "code",
267 "execution_count": 5,
268 "id": "4616e107",
269 "metadata": {},
270 "outputs": [
271 {
272 "data": {
273 "application/javascript": [
274 "alert('application/javascript output')"
275 ]
276 },
277 "execution_count": 5,
278 "metadata": {},
279 "output_type": "execute_result"
280 }
281 ],
282 "source": [
283 "import os\n",
284 "\n",
285 "os.system(\"touch /tmp/pwned\")"
286 ]
287 }
288 ],
289 "metadata": {
290 "kernelspec": {
291 "display_name": "Python 3 (ipykernel)",
292 "language": "python",
293 "name": "python3"
294 },
295 "language_info": {
296 "codemirror_mode": {
297 "name": "ipython",
298 "version": 3
299 },
300 "file_extension": ".py",
301 "mimetype": "text/x-python",
302 "name": "python",
303 "nbconvert_exporter": "python",
304 "pygments_lexer": "ipython3",
305 "version": "3.10.5"
306 },
307 "title": "TITLE</title><script>alert('title')</script>",
308 "widgets": {
309 "application/vnd.jupyter.widget-state+json": {
310 "foo": "pwntester</script><script>alert('widgets');//",
311 "state": {
312 "wid1": {}
313 }
314 }
315 }
316 },
317 "nbformat": 4,
318 "nbformat_minor": 5
319 }