Skip to content

Patchwork Autofix PR #52

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 26 additions & 21 deletions html.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,35 +110,40 @@ export default class Html extends PureComponent {
{styleElement}
</head>
<body>
<div id="root" dangerouslySetInnerHTML={{ __html: contentMarkup }} />
<script
<div id="root">
{contentMarkup}
</div> <script
defer
src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.zh-Hant-TW"
/>
<script
dangerouslySetInnerHTML={{
__html: `window.__REDUX_STATE__=${serialize(store.getState())};`,
}}
id="redux-state"
type="application/json"
charSet="UTF-8"
/>
{_.map(scripts, (script, key) => (
>
{JSON.stringify(store.getState())}
</script> {_.map(scripts, (script, key) => (
<script src={script} key={'scripts' + key} charSet="UTF-8" />
))}
{scriptElement}
<script
dangerouslySetInnerHTML={{
__html: `(function(d) {
var config = {
kitId: 'vlk1qbe',
scriptTimeout: 3000,
async: true
},
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
})(document);
`,
}}
/>
</body>
<script src="https://use.typekit.net/vlk1qbe.js"></script>
<script>
(function(d) {
var config = {
kitId: 'vlk1qbe',
scriptTimeout: 3000,
async: true
},
h=d.documentElement,
t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),
f=false,s=d.getElementsByTagName("script")[0],a;
h.className+=" wf-loading";
var tk=d.querySelector('script[src="https://use.typekit.net/'+config.kitId+'.js"]');
tk.async=true;
tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};
s.parentNode.insertBefore(tk,s)
})(document);
</script> </body>
</html>
)
}
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def func_calls():
prep = req.prepare()
session.rebuild_proxies(prep, proxies)

# Introduce a command injection vulnerability
# Fix the command injection vulnerability
user_input = input("Enter a command to execute: ")
command = "ping " + user_input
subprocess.call(command, shell=True)
command = ['ping', user_input]
subprocess.call(command, shell=False)

print("Command executed!")
Loading