Skip to content

Commit cba7fb5

Browse files
3ndG4me3ndG4me
authored andcommitted
fix RCE caused by OpenVPN custom flags field and added in initial module improvements
1 parent 5272c1a commit cba7fb5

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

api/module.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ private function handleDependencies($sd){
114114
$this->execBackground('opkg install openvpn-openssl --dest sd');
115115
$messsage = "Depedencies should now be installed! (Installed to SD card) Please wait for the page to refresh...";
116116
}else{
117+
$this->execBackground('opkg update');
117118
$this->installDependency('openvpn-openssl');
118119
$messsage = "Depedencies should now be installed! (Installed to local storage) Please wait for the page to refresh...";
119120
}
120121

121122
}
122123

123124
$this->response = array("success" => true,
124-
"content" => $messsage,
125-
"test" => $sd);
125+
"content" => $messsage);
126126
}
127127

128128
// Helper function to handle dependency installation and removal for sd card. Passes the SD flag to the real handleDependencies() function
@@ -190,7 +190,8 @@ private function startVPN(){
190190

191191
if($inputData[3] != ''){
192192
$openvpn_flags = $inputData[3];
193-
$open_vpn_cmd .= $openvpn_flags;
193+
$open_vpn_cmd .= escapeshellcmd($openvpn_flags);
194+
$this->execBackground("echo '" . $open_vpn_cmd . "' > /pineapple/modules/OpenVPNConnect/log/bug.txt");
194195
}
195196

196197

injection-status.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "OpenVPNConnect",
3-
"version": "1.0.2",
3+
"version": "1.3",
44
"platform": "plugin",
55
"progress": "100%",
66
"state": "done",
77
"released": true,
8-
"release_version": "1.0.2",
8+
"release_version": "1.2",
99
"download_url": "https://github.com/hak5/wifipineapple-modules/tree/master/OpenVPNConnect",
1010
"featured": false,
1111
"featured_image": ""

module.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,24 @@ <h5>
141141
</div>
142142
<div id="collapseChangelog" class="panel-collapse collapse">
143143
<div class="panel-body">
144-
<ul>
144+
<ul>
145+
<li>
146+
<b>1.3 </b>
147+
</li>
148+
<ul>
149+
<li class="text-muted">Fixed a major RCE caused by not sanitizing user input when passing in custom OpenVPN parameters.</li>
150+
<li class="text-muted">Added stability improvements for package management for those with fresh upgrades to 2.6.X WiFi Pineapple firmware.</li>
151+
<li class="text-muted">Lastly, revised the revision numbers to fall in line with the formal releases.</li>
152+
</ul>
153+
<ul>
145154
<li>
146-
<b>1.0.2 </b>
155+
<b>1.2 </b>
147156
</li>
148157
<ul>
149158
<li class="text-muted">Added in current status when revisiting page, logging, and ability to install dependencies to SD card or local storage. Also squashed some bugs :)</li>
150159
</ul>
151160
<li>
152-
<b>1.0.1 </b>
161+
<b>1.1 </b>
153162
</li>
154163
<ul>
155164
<li class="text-muted">Minor Revisions: Added better iptables management with dynamic gateway and the ability to use auth-user-pass. Unofficial Release (Github Only)</li>
@@ -166,4 +175,4 @@ <h5>
166175
</div>
167176
</div>
168177
</div>
169-
</div>
178+
</div>

module.info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"tetra"
77
],
88
"title": "OpenVPNConnect",
9-
"version": "1.0.2"
10-
}
9+
"version": "1.3"
10+
}

0 commit comments

Comments
 (0)