GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Some supposedly invalid addresses in the documentation point toward malicious websites · Issue #102627 · python/cpython

Some supposedly invalid addresses in the documentation point toward malicious websites #102627

New issue
Copy link
New issue
Copy link
Closed
Closed
Some supposedly invalid addresses in the documentation point toward malicious websites#102627
Copy link
Assignees
gpshead
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@Blind4Basics
Blind4Basics
opened on Mar 12, 2023
Issue body actions

Describe the problem

I found in the documentation about concurrency some examples that have been "exploited" by malicious people:
in the ThreadPoolExecutor Example

import concurrent.futures
import urllib.request

URLS = ['http://www.foxnews.com/',
        'http://www.cnn.com/',
        'http://europe.wsj.com/',
        'http://www.bbc.co.uk/',
        'http://some-made-up-domain.com/']   # <<<  (DO NOT TRY IT IN A BROWSER)
...

The last domain name is supposed to be non existent.
However, when I tried the snippet, I got a valid response on second try (the first one woke up their server).
It's not problematic with the code example, since the code of the page is just plain text, but anyone trying to go there through their browser might end up in some kind of troubles...

The content of the hosted page is apparently a "hard redirection" toward... something :

<html><head><title>Loading...</title></head>
<body>
    <script type='text/javascript'>window.location.replace(
        'http://some-made-up-domain.com/?ch=1&js=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJKb2tlbiIsImV4cCI6MTY3ODYxNjgxMywiaWF0IjoxNjc4NjA5NjEzLCJpc3MiOiJKb2tlbiIsImpzIjoxLCJqdGkiOiIydDVwdDM2ajgyNjU0YjRma281ZjhhMGciLCJuYmYiOjE2Nzg2MDk2MTMsInRzIjoxNjc4NjA5NjEzODAyNDEzfQ.H4l5qNGb5Ex8ehG3hxX_kWx8ODqTMRgJs0HBeQyCx1Q&sid=a4f97e10-c0af-11ed-b324-9d77bf5b132c'
        );
    </script>
</body>
</html>

Expected solution

Any invalid address in the docs should point to invalid page in trustful domains, to not allow this kind of security hole.


Cheers

Linked PRs

  • gh-102627: Replace address pointing toward malicious web page #102630
  • [3.11] gh-102627: Replace address pointing toward malicious web page (GH-102630) #102664
  • [3.10] gh-102627: Replace address pointing toward malicious web page (GH-102630) #102665
  • [3.9] gh-102627: Replace address pointing toward malicious web page (GH-102630) #102666
  • [3.8] gh-102627: Replace address pointing toward malicious web page (GH-102630) #102667
  • [3.7] gh-102627: Replace address pointing toward malicious web page (GH-102630) #102668

Activity

  1. Blind4Basics
    changed the title [-]Some addresses in the documentation point toward malicious websites[/-] [+]Some supposdely invalid addresses in the documentation point toward malicious websites[/+] on Mar 12, 2023
  2. Blind4Basics
    changed the title [-]Some supposdely invalid addresses in the documentation point toward malicious websites[/-] [+]Some supposedly invalid addresses in the documentation point toward malicious websites[/+] on Mar 12, 2023
  3. CAM-Gerlach commented on Mar 12, 2023

    @CAM-Gerlach
    CAM-Gerlach
    on Mar 12, 2023
    Member
    More actions

    Thanks for the report. This issue appears to be in the Python documentation, not the devguide, so I'm transferring it there.

    If the last example must be non-existent, it could presumably use a deliberately non-existing subdomain of the python.org domain, which we control, or a subdomain of the reserved example.com domain, or one of the other canonical example.* domains.

    Could you list the other examples you've found here, so they can be fixed? Would you like to submit a PR to fix this, and any others you've found? Thanks!

  4. CAM-Gerlach
    transferred this issue frompython/devguideon Mar 12, 2023
  5. CAM-Gerlach
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Mar 12, 2023
  6. Mariatta commented on Mar 12, 2023

    @Mariatta
    Mariatta
    on Mar 12, 2023
    Member
    More actions

    I agree we should update such invalid urls. I would also suggest updating even the valid urls like fox news into perhaps other more Python-related websites, but that could be done as a separate PR.

  7. Blind4Basics commented on Mar 12, 2023

    @Blind4Basics
    Blind4Basics
    on Mar 12, 2023
    ContributorAuthor
    More actions

    oh, sorry for posting in the wrong repo...

    I actually didn't search in other snippets. But in the same one, a second address is to be handled: 'http://europe.wsj.com/' (it still is invalid so far)
    Edit: it might actually be better to use only addresses you control, even for valid ones? (oh, already pointed in the previous message... x) )

    About the PR: maybe I'll give it a shot, but no guarantees.

  8. CAM-Gerlach commented on Mar 12, 2023

    @CAM-Gerlach
    CAM-Gerlach
    on Mar 12, 2023
    Member
    More actions

    I actually didn't search in other snippets. But in the same one, a second address is to be handled: 'http://europe.wsj.com/' (it still is invalid so far)

    That one's not a security issue, since the WSJ domain is still owned by WSJ (presumably, they just changed their subdomain layout), and it just redirects rather than is actually broken. We might want to change those to point to more appropriate Python-related websites and avoid any political controversy, but as @Mariatta mentioned, that's a separate issue.

    About the PR: maybe I'll give it a shot, but no guarantees.

    It would be a great issue to get started with, since it's only a one-line docs change. The devguide lays out the steps (which I figure you're probably familiar with, given your GitHub history) but let us know if you need any help! Thanks!

  9. hugovk commented on Mar 12, 2023

    @hugovk
    hugovk
    on Mar 12, 2023
    Member
    More actions

    Also https://example.com, https://example.org and https://example.net are specifically reserved for documentation.

    https://www.iana.org/domains/reserved

  10. Blind4Basics
    added a commit that references this issue on Mar 12, 2023

    Replace address pointing toward malicious web page

    This issue will close once commit 02a9021 is merged into the 'main' branch.
    02a9021
  11. Blind4Basics commented on Mar 12, 2023

    @Blind4Basics
    Blind4Basics
    on Mar 12, 2023
    ContributorAuthor
    More actions

    I made a try. Hopefully I didn't mess the workflow up, going through a fork...

  12. CAM-Gerlach commented on Mar 13, 2023

    @CAM-Gerlach
    CAM-Gerlach
    on Mar 13, 2023
    Member
    More actions

    Thanks! Reviewed it there.

  13. gpshead
    added a commit that references this issue on Mar 13, 2023

    gh-102627: Replace address pointing toward malicious web page (#102630)

    61479d4
  14. miss-islington
    added 4 commits that reference this issue on Mar 13, 2023

    pythongh-102627: Replace address pointing toward malicious web page (p…

    8153ec4

    pythongh-102627: Replace address pointing toward malicious web page (p…

    0091ef9

    pythongh-102627: Replace address pointing toward malicious web page (p…

    c6e4ea8

    pythongh-102627: Replace address pointing toward malicious web page (p…

    17b1e58
  15. gpshead commented on Mar 13, 2023

    @gpshead
    gpshead
    on Mar 13, 2023
    Member
    More actions

    thanks for the PR. merged. the backports are approved and should merge themselves after CI or when the release managers get to them. (assigned to me just to double check that happening in the future)

  16. gpshead
    self-assigned this
    on Mar 13, 2023
  17. miss-islington
    added 2 commits that reference this issue on Mar 13, 2023

    gh-102627: Replace address pointing toward malicious web page (GH-102630

    0275b12

    gh-102627: Replace address pointing toward malicious web page (GH-102630

    43f8082
  18. ned-deily
    added 3 commits that reference this issue on Mar 13, 2023

    [3.7] gh-102627: Replace address pointing toward malicious web page (G…

    00d1d32

    [3.9] gh-102627: Replace address pointing toward malicious web page (G…

    cb0b009

    [3.8] gh-102627: Replace address pointing toward malicious web page (G…

    045b252
  19. ned-deily commented on Mar 13, 2023

    @ned-deily
    ned-deily
    on Mar 13, 2023
    Member
    More actions

    All merged, thanks for the PR.

    Reacted by C.A.M. Gerlach and Gregory P. Smith
  20. ned-deily
    closed this as completedon Mar 13, 2023
  21. carljm
    added a commit that references this issue on Mar 14, 2023

    Merge branch 'main' into inlinecomp2

    6c5f269
  22. Fidget-Spinner
    added a commit that references this issue on Mar 27, 2023

    pythongh-102627: Replace address pointing toward malicious web page (p…

    e2be4e4
  23. warsaw
    added a commit that references this issue on Apr 11, 2023

    pythongh-102627: Replace address pointing toward malicious web page (p…

    b8177b8
  24. carlosroman
    added a commit that references this issue on Jun 22, 2023

    Upgrade to 3.8.17 (#26)

    e0a363f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @gpshead
    gpshead

Labels

docsDocumentation in the Doc dirDocumentation in the Doc dir

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.