TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Smuggling Python Code Using Shrugging Faces

3 pointsby juliusgeo2 months ago

1 comment

zahlman2 months ago
&gt;which creates a new REPL with some very important changes<p>I don&#x27;t like shrug! I don&#x27;t want any shrug!<p>... Of course, if you can arrange for the target system to decode and execute the embedded code, it&#x27;s already compromised...<p>&gt;eval doesn&#x27;t like statements and everyone already knows to suspect exec code.<p>If people don&#x27;t equally well suspect `eval` then education attempts have seriously failed.<p>Incidentally: one way every Pythonista can help improve OSS is to search on GitHub for insecure-but-intentional - as well as inappropriate-but-legitimate -uses of `eval` to submit PRs. For example, it often gets used to convert hex digits to raw byte values (<a href="https:&#x2F;&#x2F;github.com&#x2F;search?q=%22eval%28%5C%220x%22+lang%3APython+&amp;type=code" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;search?q=%22eval%28%5C%220x%22+lang%3APyt...</a>), rather than simply passing a `base` argument to `int`.
评论 #43413574 未加载